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

Dries drupal-devel at drupal.org
Mon May 23 20:49:09 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:   Dries
 Status:       patch

OK.  The patch does not apply against HEAD though.




Dries



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

May 19, 2005 - 22: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 - 13: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 - 13: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.




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

May 23, 2005 - 21:06 : drumm

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.







More information about the drupal-devel mailing list