Fatal error PHP 8: TypeError: abs(): Argument #1 ($num) must be of type int|float, string given in abs() (line 138 of /var/www/html/web/core/includes/common.inc)

Created on 19 August 2022, almost 2 years ago
Updated 14 November 2023, 8 months ago

Problem/Motivation

With PHP8 strict type checking, we need to calculate the correct filesize before we pass it back to Drupal.

Steps to reproduce

Create media entity
Add image field
Use form display and select S3FS Cors image form display
Fill in: 50 MB as max filesize

Form breaks with:
Message TypeError: abs(): Argument #1 ($num) must be of type int|float, string given in abs() (line 138 of /var/www/html/web/core/includes/common.inc)

Proposed resolution

Make sure that max filesize is always an int.

πŸ› Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands tomvanetten

Live updates comments and jobs are added and updated live.
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.69.0 2024