Skip to content

[ticket/17568] Add unit selector to avatar filesize setting#6999

Open
JauntyMYT wants to merge 1 commit into
phpbb:3.3.xfrom
JauntyMYT:ticket/17568
Open

[ticket/17568] Add unit selector to avatar filesize setting#6999
JauntyMYT wants to merge 1 commit into
phpbb:3.3.xfrom
JauntyMYT:ticket/17568

Conversation

@JauntyMYT

Copy link
Copy Markdown

The maximum avatar filesize setting in the ACP was entered and shown in raw bytes, while the user-facing avatar explanation and the parallel attachment settings present the value in KiB/MiB. This made the admin input inconsistent with the units shown to users.

This gives the avatar filesize field the same Bytes/KiB/MiB selector already used by the attachment settings (acp_attachments), converting the selected unit back to bytes on save. It reuses the existing get_formatted_filesize() and size_select_options() helpers, mirroring the max_filesize handling in acp_attachments.

Tracker: https://tracker.phpbb.com/browse/PHPBB-17568

Testing

Verified manually on a 3.3 board:

  • The ACP avatar setting now renders the value with a unit dropdown (a stored 6144 bytes displays as 6 + KiB, previously 6144 Bytes).
  • Saving 10 + MiB stores 10485760 bytes; the value round-trips on reload.

Note: the automated test suite was not run locally, so the "Tests pass" box is left unchecked.

The maximum avatar filesize setting in the ACP was entered and shown in
raw bytes, while the user-facing avatar explanation and the parallel
attachment settings present the value in KiB/MiB. This made the admin
input inconsistent with the units shown to users.

Give the avatar filesize field the same Bytes/KiB/MiB selector already
used by the attachment settings, converting the selected unit back to
bytes on save.

PHPBB3-17568
@github-actions

Copy link
Copy Markdown

The attempt to merge branch 3.3.x into master has completed after considering the changes in this PR.

  • Merge result: Conflict ❌

A separate PR will be needed to merge 3.3.x into master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant