Using this module on a site with PHP 8.1 I'm getting the following error:
Deprecated function: Automatic conversion of false to array is deprecated in err_translation_fixes_entity_revision_create() (line 157 of modules/contrib/err_translation_fixes/err_translation_fixes.module).
err_translation_fixes_entity_revision_create(Object, Object, NULL)
This is the offending piece of code:
$ids[] = $new_revision->id();
Checking $ids is an array before adding the new revision ID to it should resolve this issue, I believe.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | err_translation_fixes-conversion-of-false-to-array-deprecation-fix-3454211-2.patch | 866 bytes | a.hover |
Issue fork err_translation_fixes-3454211
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
Comment #2
a.hover commentedThis patch appears to resolve this problem.
However, not sure if this is the best place for the code or if the original code should be changed from:
$ids = &drupal_static(__FUNCTION__ . '_ids', FALSE);To
$ids = &drupal_static(__FUNCTION__ . '_ids', []);Not wanting to disrupt things too much, so have opted for the patch version instead.
Comment #5
abhishek_gupta1 commented@a.hover, I have tested locally. the above patch is working well for me. issue has fixed. Also Created MR easy to merge .