Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Hello,
I am missing an upload progress when uploading new files.
Upload progress is enabled on my system.
Regards,
dob
Comment | File | Size | Author |
---|---|---|---|
#24 | upload-progress-1394826-24-1.patch | 4.43 KB | dgorton |
#21 | upload-progress-1394826-21-1.patch | 4.48 KB | dgorton |
#21 | upload-progress-1394826-21-2.patch | 936 bytes | dgorton |
#16 | 1394826-upload-use-managed-file-element-3.patch | 5.35 KB | rlmumford |
#11 | 1394826-upload-use-managed-file-element-11.patch | 4.45 KB | andrewbelcher |
Comments
Comment #1
Dave ReidBecause there is no upload progress enabled on the Upload tab of the media browser, so this is not a bug, it is a feature request.
Comment #2
Dave ReidMarked #1471908: No Upload progress indicator on media browser as a duplicate of this issue.
Comment #3
rlmumfordMyself and AndrewBelcher are having a look at this at the moment. If anyone has any pointers they would be appreciated,
Comment #4
rlmumfordWe spent a few hours playing with this.
Is there a reason the upload form element is of type 'file' rather than 'managed_file'?
We changed this and eventually got the file uploading (with the throbber/progress bar as provided by that element). However, once the file had been uploaded, we would recieve an error saying the file could not be moved (Triggered in line 1551 of includes/file.inc - file_upload_save())
Does anyone have any thoughts?
Comment #5
rlmumfordHere's the patch we worked on so far, so many hours, so little code :(
Comment #6
Dave ReidI think I have this working. Please test the following patch.
Comment #7
rlmumfordA few problems,
If I click the upload link:
I see the upload bar (as expected). Once the upload is complete the input box vanishes, and I'm left with the Submit and Cancel buttons. If I click submit, I get taken (eventually back to the media library, without the file present).
If I click submit:
The upload works, and the media gets put into the file field. But no pregress bar.
Comment #8
Dave ReidYeah it works fine when used on file/add/upload but in the Media browser I get the following errors:
Comment #9
andrewbelcher CreditAttribution: andrewbelcher commentedAh, I got that, you need to add media/includes/media.pages.inc into the form_state build files...
Comment #10
andrewbelcher CreditAttribution: andrewbelcher commentedI'm pretty sure I didn't change any status...
Comment #11
andrewbelcher CreditAttribution: andrewbelcher commentedOk, so I've updated your patch with the build info stuff... However now there is a broken redirect :( I'm not quite sure what other bits you do on submit, or if that is something completely different breaking it. It redirects you to the file edit page.
Comment #12
andrewbelcher CreditAttribution: andrewbelcher commentedOk... so I should have looked at the code, I see where it redirects there now... At the bottom of the media_add_upload_submit function. < 30 lines below my edits. :(
However, in the media browser, it shouldn't be redirecting there, so my guess would be the destination query var isn't set properly. I'm not sure if that's something you've just changed Dave (the patch didn't look like it), so I'll let you look at it before I break anything else, as I'm not sure where it was setting that previously!
Comment #13
Dave ReidThe media_form_alter() function should be intercepting that redirect and modifying it to make a 'browser submit' redirect.
Comment #14
rlmumfordYeah, so if you go to browser and an fid is set it closes the browser and passes the fid back?
Comment #15
rlmumfordSo the problem is, media_form_alter doesn't seem to be getting run when the form gets submitted. In the $form array on the media browser there are two submit handlers set; media_add_upload_submit and media_browser_submit
However, when printing out $form from inside media_add_upload_submit, media_browser_submit is not in the actions array. Any ideas?
Comment #16
rlmumfordSo it was to do with the managed file ajax requests having different paths to media/browser. This patch seems to work!
Comment #17
gmclelland CreditAttribution: gmclelland commentedPatch in #16 works for me.
Comment #18
gmclelland CreditAttribution: gmclelland commented#16: 1394826-upload-use-managed-file-element-3.patch queued for re-testing.
Comment #19
Dave ReidComment #20
dgorton CreditAttribution: dgorton commentedThis will need to be re-rolled after the upload moves to the file_entity module. See #1552920: Move file/add from media to file. and #1552988: Move file/add from media to file
Comment #21
dgorton CreditAttribution: dgorton commentedTwo patches now - one to the File_Entity module and one to Media. Uploading both here.
Comment #22
mtiftI applied both patches and tested with 100 MB, 250 MB, and 1 GB files.
Comment #23
Dave ReidI think we can actually replace this with the following simpler statement:
form_load_include($form_state, 'inc', 'file_entity', 'file_entity.pages.inc');
Comment #24
dgorton CreditAttribution: dgorton commentedRerolled per #23 - small change though:
form_load_include($form_state, 'inc', 'file_entity', 'file_entity.pages');
Comment #25
mtiftReviewed with the changes (after I pulled file_entity part, which was recently committed) and it continues to work.
Comment #26
Dave ReidThanks! Committed to 7.x-2.x on Media and File entity.
http://drupalcode.org/project/file_entity.git/commit/4245995
http://drupalcode.org/project/media.git/commit/1e0d903
Comment #27
MXTI've just upgraded to last dev version but I can't view any progress bar in my media file field.
Where is it?
In drupal default "image" field I've had an option to set:
But where I can find similar option for my media file field?
Thank you
Comment #29
itaine CreditAttribution: itaine commented@MXT - Coming across the same issue. Anyone correct me if I'm wrong. Don't think this particular issue is addressing the option of progress indicator. I take it, this commit shows the progress meter if you have "uploadprogress" enabled on your server. It does show the "Bar with progress meter" during file upload on my end. However, I don't have the option in field settings to switch between it and throbber. I guess that would be another
issuefeature request :-D.Comment #30
TechNikh CreditAttribution: TechNikh commentedI am getting the same error on this page. /admin/workbench/media/add
Media 7.x-2.0-unstable6
Workbench Media 7.x-1.0
Media Browser Plus for Media 2.x 7.x-2.x-dev
File entity 7.x-2.0-unstable6
Workbench Files 7.x-1.0
Comment #31
Dave Reid@TechNikh: See #1620096: Upload Media fails after file/add was moved from Media to File Entity
Comment #32
Dominick R CreditAttribution: Dominick R commented16: 1394826-upload-use-managed-file-element-3.patch queued for re-testing.