[drupal-devel] [bug] Incorrect units for upload messages

drumm drupal-devel at drupal.org
Mon May 23 19:06:39 UTC 2005


Issue status update for http://drupal.org/node/23213

 Project:      Drupal
 Version:      4.6.0
 Component:    upload.module
 Category:     bug reports
 Priority:     normal
 Assigned to:  drumm
 Reported by:  drumm
 Updated by:   drumm
 Status:       patch

The 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.




drumm



Previous comments:
------------------------------------------------------------------------

May 19, 2005 - 14:07 : drumm

Attachment: http://drupal.org/files/issues/upload.module_4.diff (2.02 KB)

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.




------------------------------------------------------------------------

May 21, 2005 - 05:42 : Dries

Can't we store the size in bytes instead of having to multiply with
'1024 * 1024' over and over again?




------------------------------------------------------------------------

May 21, 2005 - 05:43 : Dries

Note: 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.







More information about the drupal-devel mailing list