diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityListController.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityListController.php index 4325637..63d8591 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityListController.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityListController.php @@ -30,13 +30,11 @@ class ConfigEntityListController extends EntityListController implements FormInt public function __construct($entity_type, EntityStorageControllerInterface $storage) { parent::__construct($entity_type, $storage); + $this->weightKey = FALSE; // Check if the entity type supports weighting. if (!empty($this->entityInfo['entity_keys']['weight'])) { $this->weightKey = $this->entityInfo['entity_keys']['weight']; } - else { - $this->weightKey = FALSE; - } } /** @@ -192,7 +190,7 @@ public function validateForm(array &$form, array &$form_state) { public function submitForm(array &$form, array &$form_state) { $values = $form_state['values']['entities']; - $entities = entity_load_multiple($this->entityType, array_keys($values)); + $entities = \Drupal::service('plugin.manager.entity')->getStorageController($this->entitytType)->load(array_keys($values)); foreach ($values as $id => $value) { if (isset($entities[$id]) && $entities[$id]->get($this->weightKey) != $value['weight']) { // Save entity only when its weight was changed. diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php index 4d78894..cac4e6f 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php @@ -79,7 +79,7 @@ function testList() { $this->assertIdentical($expected_operations, $actual_operations); // Test buildHeader() method. - $entity_info = entity_get_info('config_test'); + $entity_info = $this->container->get('plugin.entity.manager')->getDefinition('config_test'); $expected_items = array( 'label' => $entity_info['label'], 'operations' => 'Operations', @@ -125,7 +125,7 @@ function testListUI() { $this->assertEqual(count($elements), 2, 'Correct number of table header cells found.'); // Test the contents of each th cell. - $entity_info = entity_get_info('config_test'); + $entity_info = $this->container->get('plugin.entity.manager')->getDefinition('config_test'); $expected_items = array($entity_info['label'], 'Operations'); foreach ($elements as $key => $element) { $this->assertIdentical((string) $element[0], $expected_items[$key]);