Loading core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php +2 −2 Original line number Diff line number Diff line Loading @@ -231,8 +231,8 @@ public static function sort(ConfigEntityInterface $a, ConfigEntityInterface $b) $a_weight = isset($a->weight) ? $a->weight : 0; $b_weight = isset($b->weight) ? $b->weight : 0; if ($a_weight == $b_weight) { $a_label = $a->label(); $b_label = $b->label(); $a_label = $a->label() ?? ''; $b_label = $b->label() ?? ''; return strnatcasecmp($a_label, $b_label); } return ($a_weight < $b_weight) ? -1 : 1; Loading core/lib/Drupal/Core/Entity/EntityDeleteFormTrait.php +2 −2 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ abstract protected function logger($channel); public function getQuestion() { return $this->t('Are you sure you want to delete the @entity-type %label?', [ '@entity-type' => $this->getEntity()->getEntityType()->getSingularLabel(), '%label' => $this->getEntity()->label(), '%label' => $this->getEntity()->label() ?? $this->getEntity()->id(), ]); } Loading @@ -67,7 +67,7 @@ protected function getDeletionMessage() { $entity = $this->getEntity(); return $this->t('The @entity-type %label has been deleted.', [ '@entity-type' => $entity->getEntityType()->getSingularLabel(), '%label' => $entity->label(), '%label' => $entity->label() ?? $entity->id(), ]); } Loading core/lib/Drupal/Core/Entity/EntityInterface.php +1 −1 Original line number Diff line number Diff line Loading @@ -90,7 +90,7 @@ public function bundle(); /** * Gets the label of the entity. * * @return string|null * @return string|\Drupal\Core\StringTranslation\TranslatableMarkup|null * The label of the entity, or NULL if there is no label defined. */ public function label(); Loading core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php +1 −1 Original line number Diff line number Diff line Loading @@ -352,7 +352,7 @@ public function getReferenceableEntities($match = NULL, $match_operator = 'CONTA $entities = $this->entityTypeManager->getStorage($target_type)->loadMultiple($result); foreach ($entities as $entity_id => $entity) { $bundle = $entity->bundle(); $options[$bundle][$entity_id] = Html::escape($this->entityRepository->getTranslationFromContext($entity)->label()); $options[$bundle][$entity_id] = Html::escape($this->entityRepository->getTranslationFromContext($entity)->label() ?? ''); } return $options; Loading core/modules/block/tests/src/Functional/BlockTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -546,10 +546,10 @@ public function testBlockAccess() { * Tests block_user_role_delete. */ public function testBlockUserRoleDelete() { $role1 = Role::create(['id' => 'test_role1', 'name' => $this->randomString()]); $role1 = Role::create(['id' => 'test_role1', 'label' => 'Test role 1']); $role1->save(); $role2 = Role::create(['id' => 'test_role2', 'name' => $this->randomString()]); $role2 = Role::create(['id' => 'test_role2', 'label' => 'Test role 2']); $role2->save(); $block = Block::create([ Loading Loading
core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php +2 −2 Original line number Diff line number Diff line Loading @@ -231,8 +231,8 @@ public static function sort(ConfigEntityInterface $a, ConfigEntityInterface $b) $a_weight = isset($a->weight) ? $a->weight : 0; $b_weight = isset($b->weight) ? $b->weight : 0; if ($a_weight == $b_weight) { $a_label = $a->label(); $b_label = $b->label(); $a_label = $a->label() ?? ''; $b_label = $b->label() ?? ''; return strnatcasecmp($a_label, $b_label); } return ($a_weight < $b_weight) ? -1 : 1; Loading
core/lib/Drupal/Core/Entity/EntityDeleteFormTrait.php +2 −2 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ abstract protected function logger($channel); public function getQuestion() { return $this->t('Are you sure you want to delete the @entity-type %label?', [ '@entity-type' => $this->getEntity()->getEntityType()->getSingularLabel(), '%label' => $this->getEntity()->label(), '%label' => $this->getEntity()->label() ?? $this->getEntity()->id(), ]); } Loading @@ -67,7 +67,7 @@ protected function getDeletionMessage() { $entity = $this->getEntity(); return $this->t('The @entity-type %label has been deleted.', [ '@entity-type' => $entity->getEntityType()->getSingularLabel(), '%label' => $entity->label(), '%label' => $entity->label() ?? $entity->id(), ]); } Loading
core/lib/Drupal/Core/Entity/EntityInterface.php +1 −1 Original line number Diff line number Diff line Loading @@ -90,7 +90,7 @@ public function bundle(); /** * Gets the label of the entity. * * @return string|null * @return string|\Drupal\Core\StringTranslation\TranslatableMarkup|null * The label of the entity, or NULL if there is no label defined. */ public function label(); Loading
core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php +1 −1 Original line number Diff line number Diff line Loading @@ -352,7 +352,7 @@ public function getReferenceableEntities($match = NULL, $match_operator = 'CONTA $entities = $this->entityTypeManager->getStorage($target_type)->loadMultiple($result); foreach ($entities as $entity_id => $entity) { $bundle = $entity->bundle(); $options[$bundle][$entity_id] = Html::escape($this->entityRepository->getTranslationFromContext($entity)->label()); $options[$bundle][$entity_id] = Html::escape($this->entityRepository->getTranslationFromContext($entity)->label() ?? ''); } return $options; Loading
core/modules/block/tests/src/Functional/BlockTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -546,10 +546,10 @@ public function testBlockAccess() { * Tests block_user_role_delete. */ public function testBlockUserRoleDelete() { $role1 = Role::create(['id' => 'test_role1', 'name' => $this->randomString()]); $role1 = Role::create(['id' => 'test_role1', 'label' => 'Test role 1']); $role1->save(); $role2 = Role::create(['id' => 'test_role2', 'name' => $this->randomString()]); $role2 = Role::create(['id' => 'test_role2', 'label' => 'Test role 2']); $role2->save(); $block = Block::create([ Loading