Download & Extend

Upgrade of File component changes value of "5 MB" to "5 KB" in webform_update_7318()

Project:Webform
Version:7.x-3.18
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed (cannot reproduce)

Issue Summary

I've updated webform from 3.11 to 3.18 and realized, that the max file size is setup to 5KB (but used to be 5 MB). Then I found out, that the format of Max upload size value was changed, from field for just a number in KB, to number with a measure.
I think this is quite important change, but undocumented in release notes (I have not found it in any release notes between these two releases).
I think its joined with the Ajax upload, isnt it?

Comments

#1

Did you run update.php after you upgrade? The conversion from being always in KB to being a string with the increment included was done in webform_update_7318().

#2

Yes, I did.

#3

Title:When does the format of Max upload size value changed?» Upgrade of File component changes value of "5 MB" to "5 KB" in webform_update_7318()
Status:active» postponed (maintainer needs more info)

Here's the related code. In both my testing and just by checking this code, I can't tell how it could possibly convert a value that was previously 5 MB (which would have needed to be specified as "5120" before, since "KB" was assumed) would be converted into the string "5 KB":

    $component['extra'] = unserialize($component['extra']);
    if (!isset($component['extra']['directory'])) {
      $component['extra']['directory'] = $component['extra']['savelocation'];
      $component['extra']['scheme'] = file_default_scheme();
      $component['extra']['filtering']['size'] = $component['extra']['filtering']['size'] . ' KB';
      unset($component['extra']['savelocation']);
      $component['extra'] = serialize($component['extra']);
      drupal_write_record('webform_component', $component, array('nid', 'cid'));
    }

The key line here being $component['extra']['filtering']['size'] = $component['extra']['filtering']['size'] . ' KB';. I can't see how that could possibly remove numbers from the total. If the upgrade was somehow skipped (say you applied a patch for testing that included a different update function with the same name), then perhaps not only the file size was not upgraded but also the save directory value was lost.

We'll leave this issue open and see if we can get any confirming reports. Right now this just doesn't seem very likely.

#4

Status:postponed (maintainer needs more info)» closed (cannot reproduce)

Closing after lack of activity.

#5

I confirm: recently upgraded to 3.18 and the same happened, the file upload limit is now 5KB. I had the webform max upload size set to 5120. I set the value to 5242880 and cleared caches, then it appears to work.

nobody click here