diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBundleBase.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBundleBase.php index 6e75e6e..8e27aef 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBundleBase.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBundleBase.php @@ -84,6 +84,8 @@ public static function postDelete(EntityStorageInterface $storage, array $entiti * Thrown when attempting to rename a bundle entity. */ public function preSave(EntityStorageInterface $storage) { + parent::preSave($storage); + // Only handle renames, not creations. if (!$this->isNew() && $this->getOriginalId() !== $this->id()) { $bundle_type = $this->getEntityType(); @@ -92,8 +94,6 @@ public function preSave(EntityStorageInterface $storage) { throw new ConfigNameException("The machine name of the '{$bundle_type->getLabel()}' bundle cannot be changed."); } } - - parent::preSave($storage); } /** diff --git a/core/lib/Drupal/Core/Entity/BundleEntityFormBase.php b/core/lib/Drupal/Core/Entity/BundleEntityFormBase.php index 9ad6353..88ad30c 100644 --- a/core/lib/Drupal/Core/Entity/BundleEntityFormBase.php +++ b/core/lib/Drupal/Core/Entity/BundleEntityFormBase.php @@ -30,7 +30,8 @@ protected function protectBundleIdElement(array $form) { assert('isset($form[$id_key])'); $element = &$form[$id_key]; - // No need to redo the check if the element is already disabled. + // Make sure the element is not accidentally re-enabled if it has already + // been disabled. if (empty($element['#disabled'])) { $element['#disabled'] = !$entity->isNew(); }