Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.Problem/Motivation
Drupal 10.2.0 has deprecated the format_size() function and will remove it once Drupal 11 is released.
See the changelog
https://www.drupal.org/node/2999981
This module calls that function in a number of places. For instance,
https://git.drupalcode.org/project/webform/-/blob/6.2.x/includes/webform...
Proposed resolution
Use \Drupal\Core\StringTranslation\ByteSizeMarkup::create($size, $langcode) instead.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | Screenshot from 2024-06-13 13-05-57.png | 80.64 KB | vishal choudhary |
| #6 | 3419661-6.patch | 6.33 KB | mukhtarm |
Issue fork webform-3419661
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
Comment #2
chetan 11 commentedComment #4
chetan 11 commentedPlease check the above MR.
Comment #5
sandipta commentedThe format_size() function exists in other files as well. They are :
webform_submission_export_import.module
WebformSubmissionForm.php
WebformAdminConfigElementsForm.php
WebformManagedFileBase.php
EmailWebformHandler.php
WebformElementManagedFileLimitTest.php.
Comment #6
mukhtarm commentedHi, please review the patch. thanks
Comment #9
ankondrat4 commentedHello.
Please, review MR !398
Comment #10
cilefen commentedTests failed.
Comment #12
vishal choudharyUsing this patch Causes an error on the 6.2.x branch.
Screenshot Attached:
Comment #15
jrockowitz commentedI am finding the MRs very confusing. I created a new ticket to address the immediate deprecation. I will still give everyone commit credit on this ticket.
@see #3457437: [Drupal 10.2] format_size() is deprecated and is replaced by ByteSizeMarkup
Comment #16
jrockowitz commentedMarking fixed to ensure people get commit credit but we cant make this change until we are only supporting Drupal 10.2.x