Unverified Commit 8d7b55b8 authored by Stefan Auditor's avatar Stefan Auditor Committed by Stefan Auditor
Browse files

Issue #3253838 by sanduhrs: EntityType::hasLabelCallback has been removed from drupal:9.0.0

parent 81a284e8
Loading
Loading
Loading
Loading
−6
Changes for src/WotApiResource/ResourceObject.php: 0 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -261,13 +261,7 @@ class ResourceObject implements CacheableDependencyInterface, ResourceIdentifier
      array_keys($fields),
      [$resource_type, 'isFieldEnabled']
    );

    // The "label" field needs special treatment: some entity types have a label
    // field that is actually backed by a label callback.
    $entity_type = $entity->getEntityType();
    if ($entity_type->hasLabelCallback()) {
    $fields[static::getLabelFieldName($entity)]->value = $entity->label();
    }

    // Return a sub-array of $output containing the keys in $enabled_fields.
    $input = array_intersect_key($fields, array_flip($enabled_field_names));