diff --git a/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php b/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php index 5bc20ed..f5c6d47 100644 --- a/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php +++ b/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php @@ -205,7 +205,7 @@ public function addField($field, $type, $langcode) { // Check for a valid relationship. if (isset($propertyDefinitions[$relationship_specifier]) && $entity->{$specifier}->get('entity') instanceof EntityReference) { // If it is, use the entity type. - $entity_type = $propertyDefinitions[$relationship_specifier]->getConstraint('EntityType'); + $entity_type = $propertyDefinitions[$relationship_specifier]->getTargetDefinition()->getEntityType(); $entity_info = $entity_manager->getDefinition($entity_type); // Add the new entity base table using the table and sql column. $join_condition= '%alias.' . $entity_info->getKey('id') . " = $table.$sql_column"; diff --git a/core/modules/edit/edit.module b/core/modules/edit/edit.module index 3eaabcc..459272d 100644 --- a/core/modules/edit/edit.module +++ b/core/modules/edit/edit.module @@ -172,8 +172,7 @@ function edit_preprocess_field(&$variables) { // Fields that are not part of the entity (i.e. dynamically injected "pseudo // fields") and computed fields are not editable. - $definition = $entity->getPropertyDefinition($element['#field_name']); - if ($definition && !$definition->isComputed()) { + if ($entity->hasField($element['#field_name']) && !$entity->get($element['#field_name'])->getDefinition()->isComputed()) { $variables['attributes']['data-edit-field-id'] = $entity->entityType() . '/' . $entity->id() . '/' . $element['#field_name'] . '/' . $element['#language'] . '/' . $element['#view_mode']; } }