Unverified Commit 6ca0c8cc authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3086850 by MasterBranch, ravi.shankar, joachim, hchonov, kiwimind,...

Issue #3086850 by MasterBranch, ravi.shankar, joachim, hchonov, kiwimind, mglaman, jhedstrom: "Cannot load a NULL ID" assertion in EntityStorageBase should say the entity type

(cherry picked from commit c0f736b3)
parent 994deabd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -246,7 +246,7 @@ protected function doCreate(array $values) {
   * {@inheritdoc}
   */
  public function load($id) {
    assert(!is_null($id), 'Cannot load a NULL ID.');
    assert(!is_null($id), sprintf('Cannot load the "%s" entity with NULL ID.', $this->entityTypeId));
    $entities = $this->loadMultiple([$id]);
    return isset($entities[$id]) ? $entities[$id] : NULL;
  }
+1 −1
Original line number Diff line number Diff line
@@ -564,7 +564,7 @@ public function testLoad() {
    $this->assertSame('foo', $entity->id());

    $this->expectException(\AssertionError::class);
    $this->expectExceptionMessage('Cannot load a NULL ID.');
    $this->expectExceptionMessage(sprintf('Cannot load the "%s" entity with NULL ID.', $this->entityTypeId));
    $this->entityStorage->load(NULL);
  }