Breakage around dropzone error hander callbacks

Bug #1563143 reported by Nigel Cunningham on 2016-03-29
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Catalyst received a bug report from a customer who is using recent Mahara (15.10.1).

The initial bug report is that if "Require agreement" is enabled in admin/extensions/pluginconfig.php?plugintype=artefact&pluginname=file&type=file and a user attempts to upload a file without first ticking the agreement box, they get a message saying the box needs to be ticked but the preview of the file also has a green tick (implying it was actually uploaded).

In my investigation of the issue, I found multiple issues:

1) Dropzone's internal handling puts the green tick there on the basis of the server status. Setting the http response code to 403 (Forbidden) fixed that.
2) Dropzone's internal handling assumes that any text returned when an error occurs is an HTML (not JSON) description of the error, and therefore puts the raw HTML in 'tooltip' for the red X. The raw HTML also ends up being displayed in the files_filebrowser_upload_messages div because the JSON.parse doesn't get called in the error handler function.

I have prepared a patch that addresses both these issues, but I don't think it's the entire solution. I'd also suggest that beginning the upload should be rejected if the box hasn't been ticked. This would avoid the scenario wherein a user attempts to upload a large file on a slow connection, only to be told after the file has been sent that it's not been saved only because they didn't tick the box.

Nigel Cunningham (nigelc-g) wrote :

Attaching a patch for this issue.

Nigel Cunningham (nigelc-g) wrote :

Small addition - do the same for the nametoolong code path as well.

Putting it on "High" priority as it is confusing to users.

In general, having to tick a box when you can drop something into the browser is not good. We might need to re-think the upload agreement functionality. We do have proper licenses available now.

Changed in mahara:
importance: Undecided → High
milestone: none → 16.10.0
status: New → In Progress
no longer affects: mahara/15.04

Submitter: Son Nguyen (<email address hidden>)
Branch: 15.10_STABLE

commit 0440e879a6cdf46710b73da2d5a70f64508e12ca
Author: Robert Lyon <email address hidden>
Date: Tue Jun 7 09:49:22 2016 +1200

Bug 1563143: Avoid displaying the dropzone image preview block

This was the existing 1504 functionality


Change-Id: I9cf3ab67347c39ab22587fcb57d354fa44299bbe
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9) on 2016-10-21
Changed in mahara:
milestone: 16.10.1 → 17.04.0

Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit c400d07f9c389cc48a379f4f0ea904ed240de7e3
Author: Robert Lyon <email address hidden>
Date: Mon Nov 7 20:38:18 2016 +1300

Bug 1563143: Parse json error in file dropzone upload

When the upload agreement is on and unticked

behatnotneeded - unable to test dropzone

Change-Id: I13ae399041629db21bacdeb7270cedf7f10e25ba
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9) wrote :

Have fixed the error message handling in filedropzone.js for the 17.04 branch

no longer affects: mahara/16.04
no longer affects: mahara/16.10
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers