diff --git a/core/includes/form.inc b/core/includes/form.inc index aaa8408..83284dd 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -592,7 +592,7 @@ function template_preprocess_form_element_label(&$variables) { * // 1 (or no value explicitly set) means the operation is finished * // and the batch processing can continue to the next operation. * - * $nodes = entity_load_multiple_by_properties('node', array('uid' => $uid, 'type' => $type)); + * $nodes = Node::loadByProperties(['uid' => $uid, 'type' => $type]); * $node = reset($nodes); * $context['results'][] = $node->id() . ' : ' . SafeMarkup::checkPlain($node->label()); * $context['message'] = SafeMarkup::checkPlain($node->label()); diff --git a/core/modules/node/src/Tests/NodeFormSaveChangedTimeTest.php b/core/modules/node/src/Tests/NodeFormSaveChangedTimeTest.php index aecf8a9..a28eb50 100644 --- a/core/modules/node/src/Tests/NodeFormSaveChangedTimeTest.php +++ b/core/modules/node/src/Tests/NodeFormSaveChangedTimeTest.php @@ -2,6 +2,7 @@ namespace Drupal\node\Tests; +use Drupal\node\Entity\Node; use Drupal\simpletest\WebTestBase; /** @@ -52,11 +53,12 @@ protected function setUp() { * Test the changed time after API and FORM save without changes. */ public function testChangedTimeAfterSaveWithoutChanges() { - $node = entity_load('node', 1); + $storage = $this->container->get('entity_type.manager')->getStorage('node'); + $node = $storage->load(1); $changed_timestamp = $node->getChangedTime(); - $node->save(); - $node = entity_load('node', 1, TRUE); + $storage->resetCache([1]); + $node = $storage->load(1); $this->assertEqual($changed_timestamp, $node->getChangedTime(), "The entity's changed time wasn't updated after API save without changes."); // Ensure different save timestamps. @@ -65,7 +67,8 @@ public function testChangedTimeAfterSaveWithoutChanges() { // Save the node on the regular node edit form. $this->drupalPostForm('node/1/edit', array(), t('Save')); - $node = entity_load('node', 1, TRUE); + $storage->resetCache([1]); + $node = $storage->load(1); $this->assertNotEqual($changed_timestamp, $node->getChangedTime(), "The entity's changed time was updated after form save without changes."); } diff --git a/core/modules/node/src/Tests/NodeLoadMultipleTest.php b/core/modules/node/src/Tests/NodeLoadMultipleTest.php index 31a30ee..4add3bd 100644 --- a/core/modules/node/src/Tests/NodeLoadMultipleTest.php +++ b/core/modules/node/src/Tests/NodeLoadMultipleTest.php @@ -39,9 +39,9 @@ function testNodeMultipleLoad() { $this->assertText($node2->label(), 'Node title appears on the default listing.'); $this->assertNoText($node3->label(), 'Node title does not appear in the default listing.'); $this->assertNoText($node4->label(), 'Node title does not appear in the default listing.'); - // Load nodes with only a condition. Nodes 3 and 4 will be loaded. - $nodes = entity_load_multiple_by_properties('node', array('promote' => 0)); + $nodes = $this->container->get('entity_type.manager')->getStorage('node') + ->loadByProperties(array('promote' => 0)); $this->assertEqual($node3->label(), $nodes[$node3->id()]->label(), 'Node was loaded.'); $this->assertEqual($node4->label(), $nodes[$node4->id()]->label(), 'Node was loaded.'); $count = count($nodes);