- Issue created by @fallenturtle
- 🇩🇪Germany jurgenhaas Gottmadingen
This looks like an issue in the pathauto module, so I'm moving that issue over.
The method
\Drupal\pathauto\Plugin\Action\UpdateAction::access
looks like this:public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { $result = AccessResult::allowedIfHasPermission($account, 'create url aliases'); return $return_as_object ? $result : $result->isAllowed(); }
So, that allows $account to be NULL and it uses that to call
AccessResult::allowedIfHasPermission
which doesn't accept NULL for the account. So, before calling that method, the pathauto plugin needs to verify if account is NULL, and if so, load the current user. - 🇮🇳India prashant.c Dharamshala
@fallenturtle
It seems the steps to reproduce are from the ECA module, Could you please add the steps to reproduce with Pathauto module only that would be helpful.@jurgenhaas
public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { $result = AccessResult::allowedIfHasPermission($account, 'create url aliases'); return $return_as_object ? $result : $result->isAllowed(); }
In the following code snippet I do not see any check for when
$account
is NULL because the functionallowedIfHasPermission
has this argument as required https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Access%21...Thanks