- Issue created by @quietone
alexpott spotted this while reviewing this section from core/modules/user/src/Plugin/views/access/Permission.php as part of π Fix 'Drupal.Semantics.FunctionT.NotLiteralString' coding standard Active .
public function summaryTitle() {
$permissions = $this->permissionHandler->getPermissions();
if (isset($permissions[$this->options['perm']])) {
return $permissions[$this->options['perm']]['title'];
}
// phpcs:ignore Drupal.Semantics.FunctionT.NotLiteralString
return $this->t($this->options['perm']);
The comment copied here for convenience,
I think this code is incorrect. I think it exists from a time when permissions were not enforced and did not create dependencies. I don't think translating a non-existent permission is the correct thing to do here. I think we should log an error and just return 'user.permissions'. That said this code might become completely unreachable once views config validation ensures that the permission exists.
TBA
TBA
Active
11.0 π₯
Last updated