Corrupted AJAX on file upload becuase file_ajax_progress() returns no value

Created on 20 October 2011, over 12 years ago
Updated 3 October 2017, over 6 years ago

To Reproduce:

  • Tested on 7.8 and 7.x-dev with PECL uploadprogress PHP module, Chrome and FF with no dev modules or extensions
  • Add a form with a managed file upload element and use the 'bar' progress indicator.
  • Upload a file

This generates an AJAX error. The response is printed in the error message. The response is an obviously corrupt json string of the form:
{ progress bar info from file_ajax_progress() } [{other ajax commands}]

The prettied up json is attached.

The Likely Cause?

I'm very new to the web designing thing but as far as I can tell, file_ajax_progress() is supposed to return an ajax command array and it doesn't. It returns nothing. Instead, it echos out the progress bar message and percentage directly. ajax_deliver() then appends the other commands and creates a bad json string with 2 arrays butted together.

Am I crazy? I've tried making file_ajax_progress() return it's $progress array (in various ways) instead of echoing it. This removes the error but the progress bar doesn't appear (although the divs are inserted for it).

Next Action

Can anyone confirm this or point me in the right direction?

Thanks muchly

πŸ› Bug report
Status

Needs review

Version

7.0 ⚰️

Component
File moduleΒ  β†’

Last updated 3 days ago

Created by

πŸ‡¨πŸ‡¦Canada noland

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