Closed (fixed)
Project:
Entity API
Version:
8.x-1.x-dev
Component:
Code - misc
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Nov 2021 at 00:12 UTC
Updated:
15 Feb 2022 at 15:40 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mrweiner commentedI don't know what's going on with the issue fork or why the MR isn't showing up in here, but it's at https://git.drupalcode.org/issue/entity-3249372/-/merge_requests/1.
Comment #3
tr commentedI suspect this will fail in PHP 7. Maybe upload this as a regular patch so we can get the tests run.
Comment #4
aardwolf commentedHere's a patch file from MR.
Author of this mrweiner.
Comment #6
tr commentedThe 14 test failures are branch failures, unrelated to this patch. Those should really be fixed, but they happen because this module adds a drupalci.yml that deliberately fails when it encounters deprecations. Because every minor point release of Drupal is going to add deprecations, and because in general the deprecation changes aren't backported to other supported versions of core, we're ALWAYS going to have failing tests. Which makes it difficult to notice and fix new failures. For example, some of those failures are things deprecated in 9.3, so if we "fix" them for 9.3 then our 9.2 and 9.1 tests will fail.
Regardless, the point is to look at the PHP 8.1 failures, subtract the branch failures, and see if this patch fixed everything.
I triggered PHP 8.1 tests for this module without this patch (see https://www.drupal.org/pift-ci-job/2237552) and there are 19 failures - 14 are the normal ones, 4 are the count() error fixed by this patch, and 1 is because of
Exception: Deprecated function: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated Drupal\Component\Utility\Html::escape()which is also a PHP 8.1 problem but seems to be a core problem, not a problem with Entity API.Re #3, it seems from the tests results that this patch DOESN'T break the module under PHP 7.
Because this patch DOES fix the count() failures and doesn't break the tests for other versions of PHP, I'm marking this as RTBC.
Comment #7
tr commentedI re-opened the issue which introduced drupalci.yml (which is the reason for the branch fails). See #3101368: Let tests fail on deprecation notices.
Comment #8
alexpottHere's a patch that:
Comment #9
alexpottThat was not the patch I meant to uplaod here... here it is.
Comment #10
tr commentedThe drupalci.yml was removed in #3101368: Let tests fail on deprecation notices
Here's a re-roll of #9 without the changes to drupalci.yml.
Comment #12
tr commentedCommitted #10. Tests now run green and Entity API now works with PHP 8.1.
Comment #14
chi commentedWould be nice to have a release with this fix.
Comment #15
vikramy commented+1. A release would be good.