diff --git a/core/modules/block_content/src/BlockContentTypeForm.php b/core/modules/block_content/src/BlockContentTypeForm.php index f4131f2..3e40858 100644 --- a/core/modules/block_content/src/BlockContentTypeForm.php +++ b/core/modules/block_content/src/BlockContentTypeForm.php @@ -102,7 +102,6 @@ public function save(array $form, FormStateInterface $form_state) { } else { block_content_add_body_field($block_type->id()); - $this->addBodyField($block_type); drupal_set_message(t('Custom block type %label has been added.', array('%label' => $block_type->label()))); $logger->notice('Custom block type %label has been added.', array('%label' => $block_type->label(), 'link' => $edit_link)); } @@ -110,36 +109,4 @@ public function save(array $form, FormStateInterface $form_state) { $form_state->setRedirect('block_content.type_list'); } - /** - * Adds a body field to a block content type. - * - * @param \Drupal\block_content\BlockContentTypeInterface $block_content_type - */ - protected function addBodyField(BlockContentTypeInterface $block_content_type) { - $field = entity_create('field_config', array( - // The field storage is guaranteed to exist because it is supplied by the - // block_content module. - 'field_storage' => FieldStorageConfig::loadByName('block_content', 'body'), - 'bundle' => $block_content_type->id(), - 'label' => 'Body', - 'settings' => array('display_summary' => FALSE), - )); - $field->save(); - - // Assign widget settings for the 'default' form mode. - entity_get_form_display('block_content', $block_content_type->id(), 'default') - ->setComponent('body', array( - 'type' => 'text_textarea_with_summary', - )) - ->save(); - - // Assign display settings for 'default' view mode. - entity_get_display('block_content', $block_content_type->id(), 'default') - ->setComponent('body', array( - 'label' => 'hidden', - 'type' => 'text_default', - )) - ->save(); - } - }