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
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
Comment #2
savage1974 commentedComment #5
tribekk commentedOpened 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.
Comment #6
tribekk commentedUpdated 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.
Comment #7
tribekk commentedDuplicate of previous comment, sorry.
Comment #8
savage1974 commentedtribekk, another similar issue:
Comment #9
savage1974 commentedAnd one more (when I tried to edit my old config):
Comment #10
tribekk commentedThanks 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?
Comment #11
savage1974 commentedI 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
Comment #12
tribekk commentedМожете тогда перевести статус?)
Comment #13
savage1974 commentedКонечно )
Comment #14
savage1974 commentedComment #16
nicrodgersSetting back to needs review, the merge request hasn't been merged yet so isn't fixed