Hello!
After migrating from drupal 9 to version 11, when switching to pcp 8.4, I get the following warning::

PHP Deprecated:  Drupal\pagerer\Entity\PagererPreset::getPaneData(): Implicitly marking parameter $key as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/pagerer/src/Entity/PagererPreset.php on line 103

It is necessary to replace in the corresponding line (103):
string $key = NULL
with
string|null $key

best regards,
Savage

Issue fork pagerer-3592157

Command icon 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

savage1974 created an issue. See original summary.

savage1974’s picture

Issue summary: View changes

tribekk made their first commit to this issue’s fork.

tribekk’s picture

Status: Active » Needs review

Opened MR !31.

The key argument is nullable in practice when getPaneData() is called for the whole pane data. The MR changes the signature to ?string key = NULL and updates the phpdoc. No behavior change.

Checked locally: php -l src/Entity/PagererPreset.php; composer validate --no-check-publish; git diff --check. Composer validate only reports the existing missing license warning.

tribekk’s picture

Updated MR !31 after CI: phpcs also reported the same PHP 8.4 nullable default issue in Progressive::buildProgressivePageList() and Adaptive::buildAdaptivePageList(), so the MR now covers those two parameters as well. The latest pipeline has phpcs passing. Remaining failures look unrelated to this MR: phpstan reports existing issues in pagerer.module, Multipane.php, and Standard.php; phpunit fails PagererTest::testQuerystringOverrides on an expected query string.

tribekk’s picture

Duplicate of previous comment, sorry.

savage1974’s picture

tribekk, another similar issue:

Deprecated: Drupal\pagerer\Plugin\pagerer\Adaptive::buildAdaptivePageList(): Implicitly marking parameter $x as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/pagerer/src/Plugin/pagerer/Adaptive.php on line 211
savage1974’s picture

And one more (when I tried to edit my old config):

ArgumentCountError: Too few arguments to function Drupal\pagerer\Entity\PagererPreset::getPaneData(), 1 passed in /var/www/html/web/modules/contrib/pagerer/src/Form/PagererPresetEditForm.php on line 121 and exactly 2 expected in Drupal\pagerer\Entity\PagererPreset->getPaneData() (line 103 of modules/contrib/pagerer/src/Entity/PagererPreset.php).
tribekk’s picture

Thanks for testing.

The Adaptive::buildAdaptivePageList() deprecation should be covered by the latest MR update; it now uses ?int $x = NULL.

For the getPaneData() error, the MR keeps the second argument optional as ?string $key = NULL, so calls like getPaneData('left') from PagererPresetEditForm should still work. Could you please confirm whether this was tested with the latest MR !31?

savage1974’s picture

I checked it out. Everything was fixed normally.
I also go to the editing page without any problems. Thank you.
I've made a local patch so far. Waiting for the module update)

best regards,
Savage

tribekk’s picture

Можете тогда перевести статус?)

savage1974’s picture

Конечно )

savage1974’s picture

Status: Needs review » Fixed

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.

nicrodgers’s picture

Status: Fixed » Needs review

Setting back to needs review, the merge request hasn't been merged yet so isn't fixed