diff --git a/core/includes/entity.inc b/core/includes/entity.inc index eef980e..e12d5df 100644 --- a/core/includes/entity.inc +++ b/core/includes/entity.inc @@ -761,7 +761,7 @@ function entity_get_render_display(EntityInterface $entity, $view_mode) { $view_mode => 'entity.display.' . $entity->entityType() . '.' . $entity->bundle() . '.' . $view_mode, ); $entity_displays = \Drupal::service('config.storage')->readMultiple($ids); - if ($display = $entity_form_displays[$ids[$view_mode]] && $display['status']) { + if (isset($entity_displays[$ids[$view_mode]]) && $entity_displays[$ids[$view_mode]]['status']) { $render_view_mode = $view_mode; } } @@ -861,7 +861,7 @@ function entity_get_render_form_display(EntityInterface $entity, $form_mode) { $form_mode => 'entity.form_display.' . $entity->entityType() . '.' . $entity->bundle() . '.' . $form_mode, ); $entity_form_displays = \Drupal::service('config.storage')->readMultiple($ids); - if ($form_display = $entity_form_displays[$ids[$form_mode]] && $form_display['status']) { + if (isset($entity_form_displays[$ids[$form_mode]]) && $entity_form_displays[$ids[$form_mode]]['status']) { $render_form_mode = $form_mode; } } diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/FieldSqlStorageTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/FieldSqlStorageTest.php index 34818e0..5efa6b8 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/FieldSqlStorageTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/FieldSqlStorageTest.php @@ -26,7 +26,7 @@ class FieldSqlStorageTest extends EntityUnitTestBase { * * @var array */ - public static $modules = array('system', 'field', 'field_test', 'text', 'number', 'entity_test'); + public static $modules = array('field', 'field_test', 'text', 'number', 'entity_test'); /** * The name of the created field. @@ -67,7 +67,6 @@ public static function getInfo() { function setUp() { parent::setUp(); $this->installSchema('entity_test', array('entity_test_rev', 'entity_test_rev_revision')); - $this->installSchema('system', array('variable')); $entity_type = 'entity_test_rev'; $this->field_name = strtolower($this->randomName());