Skip to content

Instantly share code, notes, and snippets.

@ivangrozni
Created November 15, 2023 08:50
Show Gist options
  • Save ivangrozni/face9aa514e0a89b7b4b7cb913a4fdc7 to your computer and use it in GitHub Desktop.
Save ivangrozni/face9aa514e0a89b7b4b7cb913a4fdc7 to your computer and use it in GitHub Desktop.
drupal-core-role-10-1-remove.patch
diff --git a/core/modules/user/src/Entity/Role.php b/core/modules/user/src/Entity/Role.php
index 18194f3390..7417234062 100644
--- a/core/modules/user/src/Entity/Role.php
+++ b/core/modules/user/src/Entity/Role.php
@@ -204,7 +204,7 @@ public function calculateDependencies() {
$valid_permissions = array_intersect($this->permissions, array_keys($permission_definitions));
$invalid_permissions = array_diff($this->permissions, $valid_permissions);
if (!empty($invalid_permissions)) {
- throw new \RuntimeException('Adding non-existent permissions to a role is not allowed. The incorrect permissions are "' . implode('", "', $invalid_permissions) . '".');
+ @\trigger_error('Adding non-existent permissions to a role is not allowed. The incorrect permissions are "' . implode('", "', $invalid_permissions) . '".', \E_USER_DEPRECATED);
}
foreach ($valid_permissions as $permission) {
// Depend on the module that is providing this permissions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment