checkAccess in /Drupal/Core/Menu/DefaultMenuLinkTreeManipulators at line 93 expect access property to be be either NULL or an AccessResultInterface object.

The same in other class:
DomainException: MenuLinkTreeElement::access must be either NULL or an AccessResultInterface object. in Drupal\Core\Menu\MenuLinkTree->buildItems() (line 216 of /Drupal/Core/Menu/MenuLinkTree.php).

Comments

a.dmitriiev created an issue. See original summary.

a.dmitriiev’s picture

StatusFileSize
new805 bytes

Here is the patch with proposed solution

a.dmitriiev’s picture

Status: Active » Needs review
davidwbarratt’s picture

Status: Needs review » Needs work

This is correct, but the second argument should either be NULL to use the current user, or the current user service should be injected rather than making the service aware of the container.

wolffereast’s picture

StatusFileSize
new479 bytes

Re-rolled the patch to remove the current user service dependency. No need to inject the service as NULL defaults to the current user.

Just to note the symptoms - I was getting a whitescreen with error
Fatal error: Call to a member function isAllowed() on a non-object in /core/lib/Drupal/Core/Menu/DefaultMenuLinkTreeManipulators.php on line 93
This patch fixes that issue

wolffereast’s picture

Status: Needs work » Needs review

davidwbarratt’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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