I'm getting the following notice:
Warning: Undefined array key 1 in Drupal\Core\Entity\EntityAccessCheck->access() (line 62 of /var/lib/tugboat/web/core/lib/Drupal/Core/Entity/EntityAccessCheck.php)
#0 /var/lib/tugboat/web/core/includes/bootstrap.inc(346): _drupal_error_handler_real(2, 'Undefined array...', '/var/lib/...', 62)
#1 /var/lib/tugboat/web/core/lib/Drupal/Core/Entity/EntityAccessCheck.php(62): _drupal_error_handler(2, 'Undefined array...', '/var/lib/tugboa...', 62)
#2 [internal function]: Drupal\Core\Entity\EntityAccessCheck->access(Object(Symfony\Component\Routing\Route), Object(Drupal\Core\Routing\RouteMatch), Object(Drupal\Core\Session\AccountProxy))
Comments
Comment #2
cilefen commentedThere is not much to go on there. Can you get us a full stack trace please?
Comment #3
anna d commentedThe notice and solution is the same as on https://www.drupal.org/project/drupal/issues/3196247
Maybe it is related.
Comment #4
cilefen commentedAs with the other issue we need steps to reproduce this and a full stack trace.
Comment #7
quietone commentedIt is nice to see a patch but steps to reproduce are needed so that the problem is fully understood and a test can be written. Since that has not been supplied in 11 months, I am closing this issue.
Therefore, closing as cannot reproduce. If you are experiencing this problem on a supported version of Drupal reopen the issue, by setting the status to 'Active', and provide complete steps to reproduce the issue (starting from "Install Drupal core").
Comment #8
stefan lehmannJust stumbled over this error message and I'm pretty sure I know the origin of it.
If you define a custom route which checks access like this:
In this case I realised that the user needed a different special permission than access to "foo.view" and I mindlessly replaced:
with:
.. but "my special permission" doesn't work in entity_access as the string is exploded at the "." and as the permission doesn't have a dot you'll get the error message above.
The correct way is to replace it with:
Tldr; if you see this error message thrown somewhere you should probably check your code base for routes using "_entity_access" with a string which doesn't contain dots.