Problem/Motivation

\Drupal\Core\Entity\EntityBase::toUrl() triggers deprecations on PHP 8.5 when $rel is NULL.

Steps to reproduce

Run \Drupal\Tests\Core\Entity\EntityUrlTest

Proposed resolution

Check if $rel is NULL before checking if link template exists.

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

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 which downloads PHP 8.5.0RC1

Ran ddev exec -s php85 ./vendor/bin/phpunit -c core/phpunit.xml.dist core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php

OK, but there were issues!
Tests: 22, Assertions: 115, Deprecations: 5.

Applied the MR and now got

OK, but there were issues!
Tests: 22, Assertions: 115, Deprecations: 4.

With the 4 being __sleep() and __wake().

andypost’s picture

@smustgrave there's today's release with RC3 https://github.com/ddev/ddev/releases/tag/v1.24.9

+1 rtbc

smustgrave’s picture

Oh good to know! I just updated my local ddev and re-ran the test and got 0 deprecations. Short lived plugin.

  • catch committed 3694fab6 on 11.3.x
    Issue #3555918 by alexpott: \Drupal\Core\Entity\EntityBase::toUrl()...

  • catch committed 50113381 on 11.x
    Issue #3555918 by alexpott: \Drupal\Core\Entity\EntityBase::toUrl()...

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.