Problem/Motivation

Issue #3590178 fixed the mismatched Drupal.t() placeholder in the client-side max file size validation (s3fs_cors.js, max_size()), so the error no longer renders raw <em> markup. The message still only reports the limit in MB though, so a 5 GB limit reads "Max size allowed is: 5120 MB", which is hard to read.

Proposed resolution

Format the byte limit into the largest sensible unit (bytes/KB/MB/GB/TB) so the message reads "Max size allowed is: 5 GB" (or "10 MB", and so on), consistent with how core's ByteSizeMarkup presents sizes. See the attached merge request.

Remaining tasks

Review and merge the MR.

User interface changes

The max file size validation error now shows human-readable units (for example 5 GB) instead of a raw MB number.

API changes

None.

Data model changes

None.

Issue fork s3fs_cors-3593512

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ethant created an issue. See original summary.

  • heddn committed 5460f80d on 8.x-1.x authored by ethant
    task: #3593512 Show human-readable file size units in the max file size...
heddn’s picture

Status: Active » Fixed

Thanks for the contribution.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.