diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php index f4dbbf6..6825ee3 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php @@ -27,11 +27,10 @@ class CustomBlockFormController extends ContentEntityFormController { protected function prepareEntity() { $block = $this->entity; // Set up default values, if required. + $block_type = entity_load('custom_block_type', $block->bundle()); if (!$block->isNew()) { $block->setRevisionLog(NULL); } - - $block_type = entity_load('custom_block_type', $block->bundle()); // Always use the default revision setting. $block->setNewRevision($block_type->revision); } @@ -52,17 +51,6 @@ public function form(array $form, array &$form_state) { $form['#attributes']['class'][0] = drupal_html_class('block-' . $block->bundle() . '-form'); // Basic block information. - // These elements are just values so they are not even sent to the client. - $form['id'] = array( - '#type' => 'value', - '#value' => $block->id(), - ); - - $form['revision_id'] = array( - '#type' => 'value', - '#value' => $block->getRevisionId(), - ); - $form['info'] = array( '#type' => 'textfield', '#title' => t('Block description'), diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php index 82ad947..d6d006a 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php @@ -76,6 +76,12 @@ public function createDuplicate() { return $duplicate; } + /** + * {@inheritdoc} + */ + public function getRevisionId() { + return $this->get('revision_id')->value; + } /** * {@inheritdoc} @@ -229,13 +235,6 @@ public function getChangedTime() { /** * {@inheritdoc} */ - public function getRevisionId() { - return $this->get('revision_id')->value; - } - - /** - * {@inheritdoc} - */ public function getRevisionLog() { return $this->get('log')->value; }