Defect #11118

"Maximum file size" displayed on upload forms is incorrect

Added by Hubert B over 5 years ago. Updated over 5 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Attachments
Target version:2.0.3
Resolution:Fixed Affected version:2.0.1

Description

Hi there!

I just discovered a small issue: Setting "Maximum attachment size" in the Administrator's panel to 25600 kB causes a "Maximum file size" to be shown as 30 MB.

Steps to reproduce:

  1. Log in as administrator and set "Maximum attachment size" to 25600 kB
  2. Change to a project
  3. Go to the file tab
  4. Select "New file"
  5. Observe "Maximum file size" being displayed as 30 MB
  6. Go back to a project
  7. Select "New issue"
  8. Observe "Maximum size" being displayed as 30 MB
My system:
  • Debian Squeeze
  • PostgreSQL 8.4.11-0squeeze1
  • Ruby 1.8.7.302-2squeeze1
  • Rails 3.2.3
  • Redmine 2.0.1

Associated revisions

Revision 9782
Added by Jean-Philippe Lang over 5 years ago

Change in Rails' for handling localized number precision (#11118).

Revision 9784
Added by Jean-Philippe Lang over 5 years ago

Restored KB instead of kB (#11118).

Revision 9794
Added by Jean-Philippe Lang over 5 years ago

Set human size precision to Rails' default which is now 3 (#11118).

History

#1 Updated by Jean-Philippe Lang over 5 years ago

  • Status changed from New to Confirmed

Reproduced with language set to English. Works fine with language set to French.

#3 Updated by Jean-Philippe Lang over 5 years ago

  • Status changed from Confirmed to Resolved
  • Target version set to 2.0.3
  • Resolution set to Fixed

Fixed in r9782. It seems that Rails now uses the precision as the number precision instead of the decimal precision in 2.x.

#4 Updated by Jean-Philippe Lang over 5 years ago

Etienne Massip wrote:

Please also have a look at RE: Unit for Maximum Attachment Size - KiB or kB.

You're right, reverted to KB in r9784. I personally dislike IEC prefixes.

#5 Updated by Jean-Philippe Lang over 5 years ago

  • Subject changed from "Maximum file size" differs from "Maximum attachment size" to "Maximum file size" displayed on upload forms is incorrect
  • Status changed from Resolved to Closed

Merged in 2.0-stable.

#6 Updated by Etienne Massip over 5 years ago

  • Status changed from Closed to Reopened

Jean-Philippe Lang wrote:

Etienne Massip wrote:

Please also have a look at RE: Unit for Maximum Attachment Size - KiB or kB.

You're right, reverted to KB in r9784. I personally dislike IEC prefixes.

Acttually I'm right about the inconsistency betweenthe prefix used in settings tkB for 1000 bytes) and the actual chech based on a Numeric#kilobytes of 1024 bytes, but was wrong about the revert: KB is indeed not a legal prefix. So, maybe we should either set kB back again and change the check to use number_human_format_size :prefix => :si or set the prefix in settings to 'KiB' which is arguabilly not very understandable yet?

#7 Updated by Jean-Philippe Lang over 5 years ago

  • Status changed from Reopened to Closed

Rails' default is KB and I'm fine with it. According to Wikipedia the symbol for Kilobyte is kB or KB.

Also available in: Atom PDF