Problem/Motivation

\Drupal\Core\Menu\MenuActiveTrail results in deprecations on PHP 8.5 because \Drupal\Core\Menu\MenuActiveTrail::getActiveTrailIds() tries to use NULL as an array key.

Steps to reproduce

Run \Drupal\Tests\Core\Menu\MenuActiveTrailTest()

Proposed resolution

Use an empty string instead of NULL when this happens.

Remaining tasks

User interface changes

None

Introduced terminology

N/a

API changes

None

Data model changes

None

Release notes snippet

N/a

Issue fork drupal-3555836

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

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Downloaded https://addons.ddev.com/addons/ddev/ddev-php85

ddev exec -s php85 ./vendor/bin/phpunit -c core/phpunit.xml.dist core/tests/Drupal/Tests/Core/Menu/MenuActiveTrailTest.php

OK, but there were issues!
Tests: 12, Assertions: 66, Deprecations: 5.

Applied the MR and now only got 2

For record the 2 are

The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary)
The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary)

  • catch committed 8bdaf0d3 on 11.3.x
    Issue #3555836 by alexpott: \Drupal\Core\Menu\MenuActiveTrail causes...

  • catch committed f03bab25 on 11.x
    Issue #3555836 by alexpott: \Drupal\Core\Menu\MenuActiveTrail causes...
catch’s picture

Version: 11.x-dev » 11.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x and cherry-picked to 11.3.x, thanks!

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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.