.../Drupal/Core/Config/Entity/ConfigEntityBundleBase.php | 6 +++--- core/lib/Drupal/Core/Entity/BundleEntityFormBase.php | 13 +++++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBundleBase.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBundleBase.php index 0d1bbf2..49d7964 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBundleBase.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBundleBase.php @@ -105,7 +105,7 @@ public static function postDelete(EntityStorageInterface $storage, array $entiti * {@inheritdoc} * * Ensure that config entities which are bundles of other entities cannot have - * their id be renamed. + * their ID changed. */ public function preSave(EntityStorageInterface $storage) { $bundle_type = $this->getEntityType(); @@ -114,10 +114,10 @@ public function preSave(EntityStorageInterface $storage) { if (!empty($bundle_of)) { /* @var \Drupal\Core\Entity\DynamicallyFieldableEntityStorageInterface $entity_storage */ $entity_storage = \Drupal::entityManager()->getStorage($bundle_of); - assert($entity_storage instanceof DynamicallyFieldableEntityStorageInterface); + assert('$entity_storage instanceof DynamicallyFieldableEntityStorageInterface'); if ($entity_storage->hasData()) { - throw new ConfigNameException(t("The name of this @bundle cannot be changed, because @content content already exists.", [ + throw new ConfigNameException(t("The machine name of this @bundle cannot be changed, because @content content already exists.", [ '@bundle' => $bundle_type->getLabel(), '@content' => $this->entityManager()->getDefinition($bundle_of)->getLabel(), ])); diff --git a/core/lib/Drupal/Core/Entity/BundleEntityFormBase.php b/core/lib/Drupal/Core/Entity/BundleEntityFormBase.php index e91eae7..78556fa 100644 --- a/core/lib/Drupal/Core/Entity/BundleEntityFormBase.php +++ b/core/lib/Drupal/Core/Entity/BundleEntityFormBase.php @@ -2,22 +2,27 @@ /** * @file - * Contains BundleEntityFormBase. + * Contains \Drupal\Core\Entity\BundleEntityFormBase. */ namespace Drupal\Core\Entity; - /** * Class BundleEntityFormBase is a base form for bundle config entities. */ class BundleEntityFormBase extends EntityForm { /** - * Protect the id element from updates if needed. + * Protects the bundle entity's ID property's form element against changes. * * This method is assumed to be called on a completely built entity form, - * included an element for the entity id. + * including a form element for the bundle config entity's ID property. + * + * @param array $form + * The completely built entity bundle form array. + * + * @return array + * The updated entity bundle form array. */ protected function protectBundleIdElement(array $form) { $entity = $this->getEntity();