Skip to content
Snippets Groups Projects
Commit 1e6ad554 authored by Gonçalo Mateus's avatar Gonçalo Mateus Committed by Maria Fisher
Browse files

Issue #3373500 by mariacha1, lolgm: TypeError:...

Issue #3373500 by mariacha1, lolgm: TypeError: Drupal\field_permissions\FieldPermissionsService::fieldGetPermissionType(): Argument #1 ($field) must be of type Drupal\field\FieldStorageConfigInterface
parent 35ef7b33
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,7 @@ function field_permissions_help($route_name, RouteMatchInterface $route_match) {
*/
function field_permissions_entity_field_access($operation, FieldDefinitionInterface $field_definition, $account, FieldItemListInterface $items = NULL) {
$context = ($operation == 'view') ? 'view' : 'edit';
if (!$field_definition->isDisplayConfigurable($context) || empty($items) || !is_a($field_definition, '\Drupal\Core\Field\FieldConfigInterface')) {
if (!$field_definition->isDisplayConfigurable($context) || empty($items) || !is_a($field_definition->getFieldStorageDefinition(), '\Drupal\field\FieldStorageConfigInterface')) {
return AccessResult::neutral();
}
$access_field = \Drupal::service('field_permissions.permissions_service')->getFieldAccess($operation, $items, $account, $field_definition);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment