diff --git a/core/modules/block/block.install b/core/modules/block/block.install index 2c15a2a..426baf1 100644 --- a/core/modules/block/block.install +++ b/core/modules/block/block.install @@ -245,7 +245,7 @@ function block_update_8007() { } /** - * Migrate {block_custom}.body and {block_custom}.format to block_body field. + * Migrate {block_custom}.body and {block_custom}.format to body field. */ function block_update_8008() { $sandbox['#finished'] = 0; @@ -255,7 +255,7 @@ function block_update_8008() { // First, create the body field. $body_field = array( - 'name' => 'block_body', + 'name' => 'body', 'entity_type' => 'custom_block', 'type' => 'text_with_summary', 'module' => 'text', @@ -346,7 +346,7 @@ function block_update_8008() { ); // This is a core update and no contrib modules are enabled yet, so // we can assume default field storage for a faster update. - _update_8006_field_write_data_sql('custom_block', 'basic', $block->bid, $block->bid, 'block_body', $data); + _update_8006_field_write_data_sql('custom_block', 'basic', $block->bid, $block->bid, 'body', $data); $sandbox['last'] = $block->bid; $sandbox['count'] += 1; diff --git a/core/modules/block/custom_block/custom_block.module b/core/modules/block/custom_block/custom_block.module index 20460ce..a47fe4b 100644 --- a/core/modules/block/custom_block/custom_block.module +++ b/core/modules/block/custom_block/custom_block.module @@ -208,11 +208,11 @@ function custom_block_entity_bundle_info() { */ function custom_block_add_body_field($block_type_id, $label = 'Block body') { // Add or remove the body field, as needed. - $field = field_info_field('custom_block', 'block_body'); - $instance = field_info_instance('custom_block', 'block_body', $block_type_id); + $field = field_info_field('custom_block', 'body'); + $instance = field_info_instance('custom_block', 'body', $block_type_id); if (empty($field)) { $field = entity_create('field_entity', array( - 'name' => 'block_body', + 'name' => 'body', 'entity_type' => 'custom_block', 'type' => 'text_with_summary', )); @@ -220,7 +220,7 @@ function custom_block_add_body_field($block_type_id, $label = 'Block body') { } if (empty($instance)) { $instance = entity_create('field_instance', array( - 'field_name' => 'block_body', + 'field_name' => 'body', 'entity_type' => 'custom_block', 'bundle' => $block_type_id, 'label' => $label, @@ -230,14 +230,14 @@ function custom_block_add_body_field($block_type_id, $label = 'Block body') { // Assign widget settings for the 'default' form mode. entity_get_form_display('custom_block', $block_type_id, 'default') - ->setComponent('block_body', array( + ->setComponent('body', array( 'type' => 'text_textarea_with_summary', )) ->save(); // Assign display settings for 'default' view mode. entity_get_display('custom_block', $block_type_id, 'default') - ->setComponent('block_body', array( + ->setComponent('body', array( 'label' => 'hidden', 'type' => 'text_default', )) diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockCreationTest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockCreationTest.php index 1e78c6d..ff36e80 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockCreationTest.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockCreationTest.php @@ -49,7 +49,7 @@ public function testCustomBlockCreation() { // Create a block. $edit = array(); $edit['info'] = $this->randomName(8); - $edit['block_body[0][value]'] = $this->randomName(16); + $edit['body[0][value]'] = $this->randomName(16); $this->drupalPostForm('block/add/basic', $edit, t('Save')); // Check that the Basic block has been created. @@ -83,7 +83,7 @@ public function testCustomBlockCreation() { public function testDefaultCustomBlockCreation() { $edit = array(); $edit['info'] = $this->randomName(8); - $edit['block_body[0][value]'] = $this->randomName(16); + $edit['body[0][value]'] = $this->randomName(16); // Don't pass the custom block type in the url so the default is forced. $this->drupalPostForm('block/add', $edit, t('Save')); @@ -144,7 +144,7 @@ public function testBlockDelete() { $edit = array(); $edit['info'] = $this->randomName(8); $body = $this->randomName(16); - $edit['block_body[0][value]'] = $body; + $edit['body[0][value]'] = $body; $this->drupalPostForm('block/add/basic', $edit, t('Save')); // Place the block. @@ -177,7 +177,7 @@ public function testBlockDelete() { $edit2 = array(); $edit2['info'] = $this->randomName(8); $body2 = $this->randomName(16); - $edit2['block_body[0][value]'] = $body2; + $edit2['body[0][value]'] = $body2; $this->drupalPostForm('block/add/basic', $edit2, t('Save')); $this->assertNoRaw('Error message'); @@ -187,7 +187,7 @@ public function testBlockDelete() { $edit3 = array(); $edit3['info'] = $this->randomName(8); $body = $this->randomName(16); - $edit3['block_body[0][value]'] = $body; + $edit3['body[0][value]'] = $body; $this->drupalPostForm('block/add/basic', $edit3, t('Save')); // Show the delete confirm form. diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockListTest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockListTest.php index 4f34e69..3678a23 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockListTest.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockListTest.php @@ -64,7 +64,7 @@ public function testListing() { $this->assertResponse(200); $edit = array(); $edit['info'] = $label; - $edit['block_body[0][value]'] = $this->randomName(16); + $edit['body[0][value]'] = $this->randomName(16); $this->drupalPostForm(NULL, $edit, t('Save')); // Confirm that once the user returns to the listing, the text of the label diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockRevisionsTest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockRevisionsTest.php index b1d1220..4a2672d 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockRevisionsTest.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockRevisionsTest.php @@ -88,11 +88,11 @@ public function testRevisions() { // Save this as a non-default revision. $loaded->setNewRevision(); $loaded->isDefaultRevision = FALSE; - $loaded->block_body = $this->randomName(8); + $loaded->body = $this->randomName(8); $loaded->save(); $this->drupalGet('block/' . $loaded->id->value); - $this->assertNoText($loaded->block_body->value, 'Revision body text is not present on default version of block.'); + $this->assertNoText($loaded->body->value, 'Revision body text is not present on default version of block.'); // Verify that the non-default revision id is greater than the default // revision id. diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockSaveTest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockSaveTest.php index 405b50c..8a5fb54 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockSaveTest.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockSaveTest.php @@ -51,7 +51,7 @@ public function testImport() { $info = $this->randomName(8); $block = array( 'info' => $info, - 'block_body' => array(Language::LANGCODE_NOT_SPECIFIED => array(array('value' => $this->randomName(32)))), + 'body' => array(Language::LANGCODE_NOT_SPECIFIED => array(array('value' => $this->randomName(32)))), 'type' => 'basic', 'id' => $test_id ); diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTypeTest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTypeTest.php index 9ea559c..ec2d72d 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTypeTest.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTypeTest.php @@ -78,7 +78,7 @@ public function testCustomBlockTypeEditing() { // We need two block types to prevent /block/add redirecting. $this->createCustomBlockType('other'); - $instance = field_info_instance('custom_block', 'block_body', 'basic'); + $instance = field_info_instance('custom_block', 'body', 'basic'); $this->assertEqual($instance['label'], 'Block body', 'Body field was found.'); // Verify that title and body fields are displayed. @@ -99,7 +99,7 @@ public function testCustomBlockTypeEditing() { $this->assertEqual(url('block/add/basic', array('absolute' => TRUE)), $this->getUrl(), 'Original machine name was used in URL.'); // Remove the body field. - $this->drupalPostForm('admin/structure/block/custom-blocks/manage/basic/fields/custom_block.basic.block_body/delete', array(), t('Delete')); + $this->drupalPostForm('admin/structure/block/custom-blocks/manage/basic/fields/custom_block.basic.body/delete', array(), t('Delete')); // Resave the settings for this type. $this->drupalPostForm('admin/structure/block/custom-blocks/manage/basic', array(), t('Save')); // Check that the body field doesn't exist. diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/PageEditTest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/PageEditTest.php index 7fa8b36..23f1d6b 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/PageEditTest.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/PageEditTest.php @@ -32,7 +32,7 @@ public function testPageEdit() { $this->drupalLogin($this->adminUser); $title_key = 'info'; - $body_key = 'block_body[0][value]'; + $body_key = 'body[0][value]'; // Create block to edit. $edit = array(); $edit['info'] = drupal_strtolower($this->randomName(8));