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...

Comments

fizcs3 created an issue. See original summary.

studgate’s picture

@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!

fizcs3’s picture

Thank 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!

fizcs3’s picture

Status: Active » Needs review
trackleft2’s picture

Status: Needs review » Needs work

This 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

Config Ignore version 8.x-3.3
Works with Drupal: ^8.8 || ^9 || ^10 || ^11

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!

solideogloria’s picture

Issue tags: +PHP 8.4
bircher’s picture

Status: Needs work » Closed (duplicate)

This is already fixed in 8.x-3.x

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.