Problem/Motivation/Steps to reproduce
Am on config_ignore 8.x-3.3, Drupal 10.6.5, with PHP 8.4.
On the admin path: /admin/config/development/configuration/ignore,
this message appears at the top of the screen:
Deprecated: Drupal\config_ignore\Form\IgnoreSettingsForm::buildForm(): Implicitly marking parameter $request as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/config_ignore/src/Form/IgnoreSettingsForm.php on line 36
It also appears if I do a drush cr.
Proposed resolution
Looking at that line of the code:
public function buildForm(array $form, FormStateInterface $form_state, ?Request $request = NULL) {
I can see where the ? is prepended to Request, which typically addresses this issue...
but, somehow this isn't enough here.
Not sure exactly here, but from the research I've done, it seems that since FormInterface::buildForm has two parameters ($form and $form_state), and this buildForm has an extra $request parameter, that it may also be an issue in PHP 8.4...
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | config_ignore-php84-explicit-nullable-request-3583753.patch | 610 bytes | studgate |
Comments
Comment #2
studgate commented@fizcs3 Here is a patch that works for me (based on your code in the description) and solve the issue. it was a php8.4 issue, hopefully, we can commit this soon!
Comment #3
fizcs3 commentedThank you @studgate. Although I looked at your patch and scratched my head... then I figured out what is going on! Ugh.
Ok, so... if you look above at the task description, my copy-and-pasted code already has the ? prepended to Request, that your patch is adding...
My code was copy-and-pasted from the current 3.x branch here:
https://git.drupalcode.org/project/config_ignore/-/blob/8.x-3.x/src/Form/IgnoreSettingsForm.php?ref_type=heads#L36
I have 3.3 installed, the latest release for config_ignore. I assumed that 3.x code was the same. I assumed wrong...
The 3.x branch is 5 commits ahead of the latest release, and in those commits is one that does the same fix as your patch, clear back in Aug 2025:
https://git.drupalcode.org/project/config_ignore/-/commit/4c2e5f04839d2ee7a58f17a56bb2f925856b3d7a#line_246545dc1_36
That issue was marked as Closed (fixed), but the fix is still not yet in a release.
We need the maintainers' help to please consider kicking out a release with these missing commits...
The good news is that yes indeed the PHP 8.4 fix is only to add a ? mark and nothing more!
Comment #4
fizcs3 commentedComment #5
trackleft2This functionality was introduced in PHP version 7.1 https://www.php.net/manual/en/migration71.new-features.php
I was looking at our module project page where it says the minimum version of Drupal Core this module is compatible which is 8.8
Looking at the Drupal 8.8 release notes: https://www.drupal.org/project/drupal/releases/8.8.0
We can see the minimum PHP version is 7.
"php": ">=7.0.8"
According to semver, bumping the minimum supported Drupal version requires a MAJOR version bump for this module.
From the semver spec:
Rule 8: "Major version X (X.y.z | X > 0) MUST be incremented if any backward incompatible changes are introduced to the public API."
Increasing the minimum Drupal version is a backward incompatible change because:
Users running the older Drupal version cannot upgrade to the new version
It breaks compatibility with existing installations
It forces users to upgrade their Drupal installation first
This is not backward compatible, so it requires a MAJOR version increment (e.g., 3.3.0 → 4.0.0), not a minor increment (3.3.0 → 3.4.0).
Otherwise, I believe the fix is great! Thanks!
Comment #6
solideogloria commentedComment #7
bircherThis is already fixed in 8.x-3.x