diff --git a/core/includes/entity.api.php b/core/includes/entity.api.php index d385088..1bf3ef0 100644 --- a/core/includes/entity.api.php +++ b/core/includes/entity.api.php @@ -541,7 +541,7 @@ function hook_entity_field_access($operation, $field, $account) { * Alters the default access behaviour for a given field. * * Use this hook to override access grants from another module. Note that the - * default access flag is masked under the umbrella of the system module. + * original default access flag is masked under the ':default' key. * * @param array $grants * An array of grants gathered by hook_entity_field_access(). The array is diff --git a/core/lib/Drupal/Core/Entity/Field/Type/Field.php b/core/lib/Drupal/Core/Entity/Field/Type/Field.php index 39d4d2e..36c5f3a 100644 --- a/core/lib/Drupal/Core/Entity/Field/Type/Field.php +++ b/core/lib/Drupal/Core/Entity/Field/Type/Field.php @@ -296,9 +296,8 @@ public function access($operation = 'view', User $account = NULL) { // Get the default access restriction that lives within this field. $access = $this->defaultAccess($operation, $account); // Invoke hook and collect grants/denies for field access from other - // modules. Our default access flag is masked under the umbrella of the - // system module. - $grants = array('system' => $access); + // modules. Our default access flag is masked under the ':default' key. + $grants = array(':default' => $access); foreach (module_implements('entity_field_access') as $module) { $grants = array_merge($grants, array($module => module_invoke($module, 'entity_field_access', $operation, $this, $account))); } diff --git a/core/modules/system/tests/modules/entity_test/entity_test.module b/core/modules/system/tests/modules/entity_test/entity_test.module index 2594e78..6f94212 100644 --- a/core/modules/system/tests/modules/entity_test/entity_test.module +++ b/core/modules/system/tests/modules/entity_test/entity_test.module @@ -271,6 +271,6 @@ function entity_test_entity_field_access($operation, $field, $account) { function entity_test_entity_field_access_alter(array &$grants, array $context) { $field = $context['field']; if ($field->getName() == 'field_test_text' && $field->value == 'access alter value') { - $grants['system'] = FALSE; + $grants[':default'] = FALSE; } }