Closed (fixed)
Project:
Drupal core
Version:
4.6.0
Component:
upload.module
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
19 May 2005 at 20:07 UTC
Updated:
8 Jun 2005 at 04:57 UTC
The upload module stores these two particular variables as a number of megabytes so we need to multiply by 1024^2 as happens elsewhere for these messages. Seeing that something exceeeds a 1 byte quota is a bit disconcerting when you have 1 MB.
I made the patch against HEAD, but the problem does exist in 4.6.x.
| Comment | File | Size | Author |
|---|---|---|---|
| upload.module_4.diff | 2.02 KB | drumm |
Comments
Comment #1
dries commentedCan't we store the size in bytes instead of having to multiply with '1024 * 1024' over and over again?
Comment #2
dries commentedNote: this patch does not apply against DRUPAL-4-6. For HEAD, we might be better of removing the multiplications, as stated in my previous comment.
Comment #3
drummThe value is stored with a call to
system_settings_save()and the UI currently accepts a number of MB. I can't think of a good way to actually store the number of bytes instead of MB as the user entered. I suppose the best code cleanup for now would be grabbing the value in MB, multiplying, and storing in a locally scoped variable.If I have time later today I can make patches for both 4.6 and HEAD.
Comment #4
dries commentedOK. The patch does not apply against HEAD though.
Comment #5
Steven commentedI fixed it in HEAD and 4.6. I moved the multiplications to right where the variable is fetched. That way it doesn't need to be multiplied again later.
Comment #6
(not verified) commented