Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
To reproduce the bug:
- Add a File field called "File" to the Article content type
- Set the field's "Progress indicator" to "Bar with progress meter"
- Grant the "Article: Create new content" permission to the "Anonymous user" role
- Enable page caching for anonymous users
- Log out from the site
- Go to node/add/article
- Browse for a large enough file in the File field and click "Upload"
Expected behavior: Moving progress bar reflecting the upload's progress.
Observed behavior: Progress bar stuck at 0% with the "Starting upload..." message displayed until the file is fully uploaded.
Proposed solution: Firebug reveals that requests to the file/progress
Ajax callback are being cached when page caching is turned on for anonymous users. This causes the callback to always return the "Starting upload..." message with -1 for the upload progress. The attached patch solves the issue by marking the file/progress
Ajax callback uncacheable.
Comment | File | Size | Author |
---|---|---|---|
file_progress_page_cache.patch | 347 bytes | jamix | |
Comments
Comment #1
jamix CreditAttribution: jamix commentedAny feedback on this?
Comment #2
munkyonline CreditAttribution: munkyonline commentedTested on article comment form with file upload on Drupal 7.15, works without errors.
Comment #3
jasom CreditAttribution: jasom commentedPatch worked for me.
Btw, this is 3 y.o. report.
Comment #4
jasom CreditAttribution: jasom commentedHere's sandbox module: Upload progress fix and related answer from Stackexchange.
Comment #5
spelcheck CreditAttribution: spelcheck commentedCan confirm, the sandbox module above works on my 7.56 installations. If you require page caching for anonymous users, this will still allow the progress bar to function as expected.
Comment #7
KlemenDEV CreditAttribution: KlemenDEV as a volunteer and at Pylo commentedThis is still bug in D10
Comment #8
poker10 CreditAttribution: poker10 at ActivIT s.r.o. commentedThanks. So changing the version.