Skip to content
Snippets Groups Projects
Commit 9d8aa135 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #1919916 by oadaeh, larowlan, jessehs, babruix: Change label of custom...

Issue #1919916 by oadaeh, larowlan, jessehs, babruix: Change label of custom block default body field from "Block body" to just "Body".
parent ed6861bc
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -107,12 +107,12 @@ function custom_block_entity_bundle_info() { ...@@ -107,12 +107,12 @@ function custom_block_entity_bundle_info() {
* @param string $block_type_id * @param string $block_type_id
* Id of the block type. * Id of the block type.
* @param string $label * @param string $label
* (optional) The label for the body instance. Defaults to 'Block body' * (optional) The label for the body instance. Defaults to 'Body'
* *
* @return array() * @return array()
* Body field instance. * Body field instance.
*/ */
function custom_block_add_body_field($block_type_id, $label = 'Block body') { function custom_block_add_body_field($block_type_id, $label = 'Body') {
// Add or remove the body field, as needed. // Add or remove the body field, as needed.
$field = field_info_field('custom_block', 'body'); $field = field_info_field('custom_block', 'body');
$instance = field_info_instance('custom_block', 'body', $block_type_id); $instance = field_info_instance('custom_block', 'body', $block_type_id);
......
...@@ -79,12 +79,12 @@ public function testCustomBlockTypeEditing() { ...@@ -79,12 +79,12 @@ public function testCustomBlockTypeEditing() {
$this->createCustomBlockType('other'); $this->createCustomBlockType('other');
$instance = field_info_instance('custom_block', 'body', 'basic'); $instance = field_info_instance('custom_block', 'body', 'basic');
$this->assertEqual($instance->getLabel(), 'Block body', 'Body field was found.'); $this->assertEqual($instance->getLabel(), 'Body', 'Body field was found.');
// Verify that title and body fields are displayed. // Verify that title and body fields are displayed.
$this->drupalGet('block/add/basic'); $this->drupalGet('block/add/basic');
$this->assertRaw('Block description', 'Block info field was found.'); $this->assertRaw('Block description', 'Block info field was found.');
$this->assertRaw('Block body', 'Body field was found.'); $this->assertRaw('Body', 'Body field was found.');
// Change the block type name. // Change the block type name.
$edit = array( $edit = array(
...@@ -104,7 +104,7 @@ public function testCustomBlockTypeEditing() { ...@@ -104,7 +104,7 @@ public function testCustomBlockTypeEditing() {
$this->drupalPostForm('admin/structure/block/custom-blocks/manage/basic', array(), t('Save')); $this->drupalPostForm('admin/structure/block/custom-blocks/manage/basic', array(), t('Save'));
// Check that the body field doesn't exist. // Check that the body field doesn't exist.
$this->drupalGet('block/add/basic'); $this->drupalGet('block/add/basic');
$this->assertNoRaw('Block body', 'Body field was not found.'); $this->assertNoRaw('Body', 'Body field was not found.');
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment