editor_image_upload_settings_form() is wrongly translating the max file size

Created on 21 September 2018, almost 6 years ago
Updated 8 March 2024, 6 months ago

From #2157945-72: Deprecate format_size() and use Drupal\Core\StringTranslation\ByteSizeMarkup instead :

Problem/Motivation

this code

  $default_max_size = format_size(file_upload_max_size());
  $form['max_size'] = [
    '#type' => 'textfield',
    '#default_value' => $image_upload['max_size'],
    '#title' => t('Maximum file size'),
    '#description' => t('If this is left empty, then the file size will be limited by the PHP maximum upload size of @size.', ['@size' => $default_max_size]),
    '#maxlength' => 20,
    '#size' => 10,
    '#placeholder' => $default_max_size,
    '#states' => $show_if_image_uploads_enabled,
  ];

Is wrong. Because you need to enter a valid PHP file size so it shouldn't be translated.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Closed: duplicate

Version

11.0 🔥

Component
Editor 

Last updated 1 day ago

Created by

🇮🇹Italy mondrake 🇮🇹

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024