Page caching breaks file upload progress bar for anonymous users

Created on 11 June 2012, about 12 years ago
Updated 20 November 2023, 7 months ago

To reproduce the bug:

  1. Add a File field called "File" to the Article content type
  2. Set the field's "Progress indicator" to "Bar with progress meter"
  3. Grant the "Article: Create new content" permission to the "Anonymous user" role
  4. Enable page caching for anonymous users
  5. Log out from the site
  6. Go to node/add/article
  7. 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.

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
File module 

Last updated 3 days ago

Created by

🇸🇰Slovakia jamix

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024