Problem/Motivation

exif_custom automated tests expose an issue when using PHP 8.1.

https://www.drupal.org/pift-ci-job/2333429

Fix it by making a small change, should be easy to do.

exception: [Deprecated function] Line 153 of sites/all/modules/file_entity/file_entity.pages.inc:
explode(): Passing null to parameter #2 ($string) of type string is deprecated

✓		- testProcess
	✗	
file_entity_validate_size_extensions

exception: [Deprecated function] Line 230 of sites/all/modules/file_entity/file_entity.pages.inc:
explode(): Passing null to parameter #2 ($string) of type string is deprecated

line 153 and line 230 of file_entity.pages.inc

Proposed resolution

create a patch (easy)

Remaining tasks

Create a patch (easy)

User interface changes

N/A

API changes

Minor

Data model changes

N/A

Comments

joseph.olstad created an issue. See original summary.

joseph.olstad’s picture

Assigned: joseph.olstad » Unassigned
joseph.olstad’s picture

joseph.olstad’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 3: file_entity-php81_compatibility-3267961-03.patch, failed testing. View results

joseph.olstad’s picture

StatusFileSize
new1.56 KB

New patch, oops on the other one

joseph.olstad’s picture

Status: Needs work » Needs review

  • joseph.olstad committed e570872 on 7.x-3.x
    Issue #3267961 by joseph.olstad: file_entity - PHP 8.1 compatibility
    

  • joseph.olstad committed 0c1402a on 7.x-2.x
    Issue #3267961 by joseph.olstad: file_entity - PHP 8.1 compatibility
    
joseph.olstad’s picture

I needed to commit this to trigger exif_custom automated tests.

joseph.olstad’s picture

Status: Needs review » Fixed
joseph.olstad’s picture

yes I know I could have made a fancier fix, like cast the variable_get call to a string
(string) variable_get('blah')

however I did it in a simple way that should be highly compatible with all versions of PHP.
I don't think there's much of a performance concern for this particular section of code anyway.

Status: Fixed » Closed (fixed)

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

joseph.olstad’s picture

very strange, automated tests now show 24 fails for PHP 8.1 ???.

joseph.olstad’s picture

Status: Closed (fixed) » Active
joseph.olstad’s picture

Status: Active » Needs work
joseph.olstad’s picture

joseph.olstad’s picture

Status: Needs work » Fixed

The problem is not file_entity, the problem is caused by changes made to the ci test runner.
#3294386: All of D7 contrib project tests failing (with Composer 2)

Status: Fixed » Closed (fixed)

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