Issue #3449564 by harivansh, bbrala: Calling normalize without account context generates a warning

(cherry picked from commit a27a4622ab)
merge-requests/8377/head
catch 2024-05-28 12:54:37 +01:00
parent 5a6eea068e
commit ad1e45b875
1 changed files with 1 additions and 1 deletions

View File

@ -165,7 +165,7 @@ class ResourceObjectNormalizer extends NormalizerBase {
// entities do not have "real" fields and therefore do not have field access
// restrictions.
if ($field instanceof FieldItemListInterface) {
$field_access_result = $field->access('view', $context['account'], TRUE);
$field_access_result = $field->access('view', $context['account'] ?? NULL, TRUE);
if (!$field_access_result->isAllowed()) {
return new CacheableOmission(CacheableMetadata::createFromObject($field_access_result));
}