floor(): Passing null to parameter #1 ($num) is deprecated

Created on 16 June 2023, about 1 year ago

Problem/Motivation

There are PHP deprecation and warnings in TranscoderAbstractionFactoryFfmpeg::extractFrames()

exception: [Warning] Line 202 of sites/all/modules/video/transcoders/TranscoderAbstractionFactoryFfmpeg.inc:
Trying to access array offset on value of type bool

exception: [Warning] Line 202 of sites/all/modules/video/transcoders/TranscoderAbstractionFactoryFfmpeg.inc:
Trying to access array offset on value of type null

exception: [Deprecated] Line 202 of sites/all/modules/video/transcoders/TranscoderAbstractionFactoryFfmpeg.inc:
floor(): Passing null to parameter #1 ($num) of type int|float is deprecated

$this->getFileInfo() call can return FALSE in some cases, therefore we need to sanitize subsequent call to floor().

See: https://www.drupal.org/pift-ci-job/2694249 β†’

Steps to reproduce

Run tests on PHP 8.1

Proposed resolution

Check if the $file_info duration iset.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

2.0

Component

General

Created by

πŸ‡ΈπŸ‡°Slovakia poker10

Live updates comments and jobs are added and updated live.
  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024