Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
system.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 Dec 2021 at 07:33 UTC
Updated:
16 Feb 2022 at 12:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
joelpittetComment #3
joelpittetComment #5
joelpittetComment #7
mulambo commented@joelpittet: I've fixed your merge request (you created merge request to 9.4.x) to 7.x.
I've also created patch from your commits to be used while waiting for merge.
Comment #8
mulambo commentedComment #10
joelpittet@Mulambo FYI you can use the merge request to get the patch.
https://git.drupalcode.org/project/drupal/-/merge_requests/1629
Can be converted to a patch with: .diff or .patch at the end:
https://git.drupalcode.org/project/drupal/-/merge_requests/1629.patch
https://git.drupalcode.org/project/drupal/-/merge_requests/1629.diff
Same can be done in github pull requests.
Comment #11
mulambo commented@joelpittet Thanks for the info, didn't know about patches from merge requests.
Comment #12
mcdruid commentedIdeally we'd like one or more tests to accompany all of these PHP 8.1 fixes.
However, both of these changes look like they're buried in long functions that are not well suited to targetted unit testing.
Is there any existing test coverage that could be adapted / built upon to exercise this problem with PHP 8.1?
Comment #13
mcdruid commentedWow, the functions we're changing here really don't lend themselves to nice clean unit tests :)
I think this ought to work, but I'm having trouble getting it to fail with PHP 8.1 locally. Let's see what the bot says.
It's actually the module's dependencies that cause a problem if they have a null version, so we need two test modules.
I'm fairly certain this test results in this line getting a null version:
https://git.drupalcode.org/project/drupal/-/blob/7.87/modules/system/sys...
...so I'm not sure why I'm getting no error locally.
Comment #14
mcdruid commentedWell that certainly seems to have triggered the exception with PHP 8.1 - strictly speaking I think this is only exercising the code in system.admin.inc and not the .install function that we're also changing. I think that's probably sufficient though.
Here's the test only patch again with a tiny tweak (proper version for the test module that requires the problematic dependency) plus a test + fix patch (latest from the MR).
Comment #16
mcdruid commentedThanks everyone!