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.

Issue fork webform-3419661

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

Mingsong created an issue. See original summary.

chetan 11’s picture

Assigned: Unassigned » chetan 11

chetan 11’s picture

Assigned: chetan 11 » Unassigned
Status: Active » Needs review

Please check the above MR.

sandipta’s picture

The 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.

mukhtarm’s picture

StatusFileSize
new6.33 KB

Hi, please review the patch. thanks

Status: Needs review » Needs work

The last submitted patch, 6: 3419661-6.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

ankondrat4 made their first commit to this issue’s fork.

ankondrat4’s picture

Status: Needs work » Needs review

Hello.

Please, review MR !398

cilefen’s picture

Status: Needs review » Needs work

Tests failed.

vishal choudhary’s picture

StatusFileSize
new80.64 KB

Using this patch Causes an error on the 6.2.x branch.
Screenshot Attached:

  • 1e0ff27a committed on 6.2.x
    Issue #3419661: format_size() is deprecated and will be removed in...

  • 1a9d7851 committed on 6.2.x
    Revert "Issue #3419661: format_size() is deprecated and will be removed...
jrockowitz’s picture

I 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

jrockowitz’s picture

Status: Needs work » Fixed

Marking fixed to ensure people get commit credit but we cant make this change until we are only supporting Drupal 10.2.x

  • 1a9d7851 committed on 6.x
    Revert "Issue #3419661: format_size() is deprecated and will be removed...

  • 1e0ff27a committed on 6.x
    Issue #3419661: format_size() is deprecated and will be removed in...

Status: Fixed » Closed (fixed)

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