Problem/Motivation

EntityRouteEnhancerTest does $this->assertIsCallable($new_defaults['_controller']); but this fails in PHP 8 due to https://3v4l.org/21CAr

Steps to reproduce

See https://3v4l.org/21CAr and #3156595: Make Drupal 9 installable on PHP8

Proposed resolution

Remove assertion

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

N/a

CommentFileSizeAuthor
#2 3179013-2.patch838 bytesalexpott

Comments

alexpott created an issue. See original summary.

alexpott’s picture

alexpott’s picture

Status: Active » Needs review
andypost’s picture

Not sure it's good idea to remove this check, how come that controller is not callable?
maybe just improve defaults for controller? or it's because core using magic strings to define callables?

alexpott’s picture

@andypost see https://3v4l.org/21CAr - it's not callable without instantiating the class.

andypost’s picture

Status: Needs review » Reviewed & tested by the community

Yes, it should be removed because controller needs resolver to make sure the callable is valid

According to https://www.drupal.org/node/2092643 controller could be service.name:[method] so this assertion will fail again

andypost’s picture

It could use https://3v4l.org/k4aD0 but looks better to remove or replace with something that testing exact result

  • catch committed 88062df on 9.2.x
    Issue #3179013 by alexpott, andypost: EntityRouteEnhancerTest has a...

  • catch committed 424a739 on 9.1.x
    Issue #3179013 by alexpott, andypost: EntityRouteEnhancerTest has a...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 9.2.x and cherry-picked to 9.1.x, thanks!

Status: Fixed » Closed (fixed)

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