diff --git a/core/modules/content_translation/src/ContentTranslationHandler.php b/core/modules/content_translation/src/ContentTranslationHandler.php index 19ba5a1..b619036 100644 --- a/core/modules/content_translation/src/ContentTranslationHandler.php +++ b/core/modules/content_translation/src/ContentTranslationHandler.php @@ -100,7 +100,6 @@ public function entityFormAlter(array &$form, FormStateInterface $form_state, En unset($translations[$form_langcode]); } $is_translation = !$form_object->isDefaultFormLangcode($form_state); - debug($translations, 'translations'); $has_translations = count($translations) > 1; // Adjust page title to specify the current language being edited, if we @@ -118,8 +117,6 @@ public function entityFormAlter(array &$form, FormStateInterface $form_state, En // Display source language selector only if we are creating a new // translation and there are at least two translations available. - debug($has_translations, 'has'); - debug($new_translation, 'new'); if ($has_translations && $new_translation) { $form['source_langcode'] = array( '#type' => 'details', diff --git a/core/modules/system/entity.api.php b/core/modules/system/entity.api.php index a50f3e4..3828689 100644 --- a/core/modules/system/entity.api.php +++ b/core/modules/system/entity.api.php @@ -8,6 +8,7 @@ use Drupal\Component\Utility\String; use Drupal\Core\Access\AccessResult; use Drupal\Core\Entity\ContentEntityInterface; +use Drupal\Core\Entity\DynamicallyFieldableEntityStorageInterface; use Drupal\Core\Field\BaseFieldDefinition; use Drupal\Core\Render\Element; @@ -1738,20 +1739,21 @@ function hook_entity_bundle_field_info_alter(&$fields, \Drupal\Core\Entity\Entit * @see \Drupal\Core\Entity\EntityManagerInterface::getFieldStorageDefinitions() */ function hook_entity_field_storage_info(\Drupal\Core\Entity\EntityTypeInterface $entity_type) { - // Expose storage definitions for all exposed bundle fields. - // Query by filtering on the ID as this is more efficient than filtering - // on the entity_type property directly. - $ids = \Drupal::entityQuery('field_storage_config') - ->condition('id', $entity_type->id() . '.', 'STARTS_WITH') - ->execute(); + if (\Drupal::entityManager()->getStorage($entity_type->id()) instanceof DynamicallyFieldableEntityStorageInterface) { + // Query by filtering on the ID as this is more efficient than filtering + // on the entity_type property directly. + $ids = \Drupal::entityQuery('field_storage_config') + ->condition('id', $entity_type->id() . '.', 'STARTS_WITH') + ->execute(); + // Fetch all fields and key them by field name. + $field_storages = entity_load_multiple('field_storage_config', $ids); + $result = array(); + foreach ($field_storages as $field_storage) { + $result[$field_storage->getName()] = $field_storage; + } - // Fetch all fields and key them by field name. - $field_storages = entity_load_multiple('field_storage_config', $ids); - $result = array(); - foreach ($field_storages as $field_storage) { - $result[$field_storage->getName()] = $field_storage; + return $result; } - return $result; } /** diff --git a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php index 33d8fc6..b4e3fce 100644 --- a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php +++ b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php @@ -62,10 +62,9 @@ protected function setUp() { // If this is an entity with field UI enabled, then add a configurable // field. We will use this configurable field in later tests to ensure that - // modifications to field (instance) configuration invalidate render cache - // entries. + // field configuration invalidate render cache entries. if ($this->entity->getEntityType()->get('field_ui_base_route')) { - // Add field, so we can modify the Field and FieldInstance entities to + // Add field, so we can modify the field storage and field entities to // verify that changes to those indeed clear cache tags. entity_create('field_storage_config', array( 'field_name' => 'configurable_field',