Problem/Motivation

The file_managed.filesize column could be null, if the file size couldn't be determined. So we need to check that the file size is not null before passing to format_size(), which expects an integer.

in web\modules\contrib\commerce_file\commerce_file.module
$variables['file_size'] = format_size($file->getSize());

Steps to reproduce

Proposed resolution

https://www.drupal.org/project/drupal/issues/3261229

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#2 3379110-2.patch764 bytesalexdoma
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

alexdoma created an issue. See original summary.

alexdoma’s picture

StatusFileSize
new764 bytes

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

abhishek_gupta1’s picture

Status: Active » Needs review

@TomTech, I have fixed the issue "Passing null to parameter #1 ($num) of type int|float to abs() is deprecated", created MR. please kindly review the MR

jsacksick’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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