diff --git a/core/modules/block_content/block_content.info.yml b/core/modules/block_content/block_content.info.yml index e9e7afb..9b3421c 100644 --- a/core/modules/block_content/block_content.info.yml +++ b/core/modules/block_content/block_content.info.yml @@ -1,6 +1,6 @@ -name: 'Custom Block' +name: 'Block Content' type: module -description: 'Allows the creation of custom blocks through the user interface.' +description: 'Allows the creation of block content through the user interface.' package: Core version: VERSION core: 8.x diff --git a/core/modules/block_content/block_content.links.action.yml b/core/modules/block_content/block_content.links.action.yml index 735e374..f541e4b 100644 --- a/core/modules/block_content/block_content.links.action.yml +++ b/core/modules/block_content/block_content.links.action.yml @@ -1,12 +1,12 @@ block_content_type_add: route_name: block_content.type_add - title: 'Add custom block type' + title: 'Add block content type' appears_on: - block_content.type_list block_content_add_action: route_name: block_content.add_page - title: 'Add custom block' + title: 'Add block content' appears_on: - block.admin_display - block.admin_display_theme diff --git a/core/modules/block_content/block_content.links.task.yml b/core/modules/block_content/block_content.links.task.yml index 61ab18a..3a87c44 100644 --- a/core/modules/block_content/block_content.links.task.yml +++ b/core/modules/block_content/block_content.links.task.yml @@ -1,5 +1,5 @@ block_content.list: - title: 'Custom block library' + title: 'Block content library' route_name: block_content.list base_route: block.admin_display block_content.list_sub: @@ -20,7 +20,7 @@ entity.block_content.delete_form: route_name: entity.block_content.delete_form base_route: entity.block_content.canonical -# Default tab for custom block type editing. +# Default tab for block content type editing. entity.block_content_type.edit_form: title: 'Edit' route_name: entity.block_content_type.edit_form diff --git a/core/modules/block_content/block_content.module b/core/modules/block_content/block_content.module index dd36852..76c8d8f 100644 --- a/core/modules/block_content/block_content.module +++ b/core/modules/block_content/block_content.module @@ -2,7 +2,7 @@ /** * @file - * Allows the creation of custom blocks through the user interface. + * Allows the creation of block content through the user interface. */ use Drupal\Core\Routing\RouteMatchInterface; @@ -17,13 +17,13 @@ function block_content_help($route_name, RouteMatchInterface $route_match) { case 'help.page.block_content': $output = ''; $output .= '
' . t('The Custom Block module allows you to create blocks of content, which can be placed in regions throughout the website. Custom blocks can have fields; see the Field module help for more information. Once created, custom blocks can be placed like blocks provided by other modules; see the Block module help page for details. For more information, see the online documentation for the Custom Block module.', array('!block-content' => \Drupal::url('block_content.list'), '!field-help' => \Drupal::url('help.page', array('name' => 'field')), '!blocks' => \Drupal::url('help.page', array('name' => 'block')), '!online-help' => 'https://drupal.org/documentation/modules/block_content')) . '
'; + $output .= '' . t('The Block Content module allows you to create blocks of content, which can be placed in regions throughout the website. Block content can have fields; see the Field module help for more information. Once created, custom blocks can be placed like blocks provided by other modules; see the Block module help page for details. For more information, see the online documentation for the Custom Block module.', array('!block-content' => \Drupal::url('block_content.list'), '!field-help' => \Drupal::url('help.page', array('name' => 'field')), '!blocks' => \Drupal::url('help.page', array('name' => 'block')), '!online-help' => 'https://drupal.org/documentation/modules/block_content')) . '
'; $output .= '' . format_plural(count($blocks), '%label is used by 1 custom block on your site. You can not remove this block type until you have removed all of the %label blocks.', '%label is used by @count custom blocks on your site. You may not remove %label until you have removed all of the %label custom blocks.', array('%label' => $this->entity->label())) . '
'; + $caption = '' . format_plural(count($blocks), '%label is used by 1 block content on your site. You can not remove this block type until you have removed all of the %label blocks.', '%label is used by @count block content on your site. You may not remove %label until you have removed all of the %label block content.', array('%label' => $this->entity->label())) . '
'; $form['description'] = array('#markup' => $caption); return $form; } @@ -85,8 +85,8 @@ public function buildForm(array $form, FormStateInterface $form_state) { */ public function submitForm(array &$form, FormStateInterface $form_state) { $this->entity->delete(); - drupal_set_message(t('Custom block type %label has been deleted.', array('%label' => $this->entity->label()))); - $this->logger('block_content')->notice('Custom block type %label has been deleted.', array('%label' => $this->entity->label())); + drupal_set_message(t('Block content type %label has been deleted.', array('%label' => $this->entity->label()))); + $this->logger('block_content')->notice('Block content type %label has been deleted.', array('%label' => $this->entity->label())); $form_state->setRedirectUrl($this->getCancelUrl()); } diff --git a/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php b/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php index 393ee45..b786783 100644 --- a/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php +++ b/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php @@ -18,11 +18,11 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Defines a generic custom block type. + * Defines a generic block content type. * * @Block( * id = "block_content", - * admin_label = @Translation("Custom block"), + * admin_label = @Translation("block content"), * category = @Translation("Custom"), * deriver = "Drupal\block_content\Plugin\Derivative\BlockContent" * ) @@ -98,9 +98,9 @@ public function defaultConfiguration() { 'status' => TRUE, 'info' => '', 'view_mode' => 'full', - // Modify the default max age for custom block blocks: modifications made - // to them will automatically invalidate corresponding cache tags, thus - // allowing us to cache custom block blocks forever. + // Modify the default max age for block content: modifications made to + // them will automatically invalidate corresponding cache tags, thus + // allowing us to cache block content forever. 'cache' => array( 'max_age' => \Drupal\Core\Cache\Cache::PERMANENT, ), @@ -128,7 +128,7 @@ public function blockForm($form, FormStateInterface $form_state) { * {@inheritdoc} */ public function blockSubmit($form, FormStateInterface $form_state) { - // Invalidate the block cache to update custom block-based derivatives. + // Invalidate the block cache to update block content based derivatives. $this->configuration['view_mode'] = $form_state->getValue('view_mode'); $this->blockManager->clearCachedDefinitions(); } @@ -143,7 +143,7 @@ public function build() { } else { return array( - '#markup' => t('Block with uuid %uuid does not exist. Add custom block.', array( + '#markup' => t('Block with uuid %uuid does not exist. Add block content.', array( '%uuid' => $uuid, '!url' => $this->urlGenerator->generate('block_content.add_page') )), diff --git a/core/modules/block_content/src/Plugin/Derivative/BlockContent.php b/core/modules/block_content/src/Plugin/Derivative/BlockContent.php index 54ec325..2294efa 100644 --- a/core/modules/block_content/src/Plugin/Derivative/BlockContent.php +++ b/core/modules/block_content/src/Plugin/Derivative/BlockContent.php @@ -10,7 +10,7 @@ use Drupal\Component\Plugin\Derivative\DeriverBase; /** - * Retrieves block plugin definitions for all custom blocks. + * Retrieves block plugin definitions for all block content. */ class BlockContent extends DeriverBase { /** diff --git a/core/modules/block_content/src/Plugin/Menu/LocalAction/BlockContentAddLocalAction.php b/core/modules/block_content/src/Plugin/Menu/LocalAction/BlockContentAddLocalAction.php index e22425e..bcd8195 100644 --- a/core/modules/block_content/src/Plugin/Menu/LocalAction/BlockContentAddLocalAction.php +++ b/core/modules/block_content/src/Plugin/Menu/LocalAction/BlockContentAddLocalAction.php @@ -12,7 +12,7 @@ use Symfony\Component\HttpFoundation\Request; /** - * Modifies the 'Add custom block' local action. + * Modifies the 'Add block content' local action. */ class BlockContentAddLocalAction extends LocalActionDefault { @@ -25,11 +25,11 @@ public function getOptions(Request $request) { if ($request->attributes->has('theme')) { $options['query']['theme'] = $request->attributes->get('theme'); } - // Adds a destination on custom block listing. + // Adds a destination on block content listing. if ($request->attributes->get(RouteObjectInterface::ROUTE_NAME) == 'block_content.list') { $options['query']['destination'] = 'admin/structure/block/block-content'; } - // Adds a destination on custom block listing. + // Adds a destination on block content listing. if ($request->attributes->get(RouteObjectInterface::ROUTE_NAME) == 'block_content.list') { $options['query']['destination'] = 'admin/structure/block/block-content'; } diff --git a/core/modules/block_content/src/Tests/BlockContentCacheTagsTest.php b/core/modules/block_content/src/Tests/BlockContentCacheTagsTest.php index cc7ae4a..186d854 100644 --- a/core/modules/block_content/src/Tests/BlockContentCacheTagsTest.php +++ b/core/modules/block_content/src/Tests/BlockContentCacheTagsTest.php @@ -11,7 +11,7 @@ use Drupal\system\Tests\Entity\EntityCacheTagsTestBase; /** - * Tests the Custom Block entity's cache tags. + * Tests the Block Content entity's cache tags. * * @group block_content */ @@ -26,7 +26,7 @@ class BlockContentCacheTagsTest extends EntityCacheTagsTestBase { * {@inheritdoc} */ protected function createEntity() { - // Create a "Llama" custom block. + // Create a "Llama" block content. $block_content = entity_create('block_content', array( 'info' => 'Llama', 'type' => 'basic', diff --git a/core/modules/block_content/src/Tests/BlockContentCreationTest.php b/core/modules/block_content/src/Tests/BlockContentCreationTest.php index 0262dd4..bac7a81 100644 --- a/core/modules/block_content/src/Tests/BlockContentCreationTest.php +++ b/core/modules/block_content/src/Tests/BlockContentCreationTest.php @@ -77,7 +77,7 @@ public function testBlockContentCreation() { // Check that the block exists in the database. $blocks = entity_load_multiple_by_properties('block_content', array('info' => $edit['info[0][value]'])); $block = reset($blocks); - $this->assertTrue($block, 'Custom Block found in database.'); + $this->assertTrue($block, 'Block Content found in database.'); // Check that attempting to create another block with the same value for // 'info' returns an error. @@ -91,16 +91,16 @@ public function testBlockContentCreation() { } /** - * Create a default custom block. + * Create a default block content. * - * Creates a custom block from defaults and ensures that the 'basic block' + * Creates a block content from defaults and ensures that the 'basic block' * type is being used. */ public function testDefaultBlockContentCreation() { $edit = array(); $edit['info[0][value]'] = $this->randomMachineName(8); $edit['body[0][value]'] = $this->randomMachineName(16); - // Don't pass the custom block type in the url so the default is forced. + // Don't pass the block content type in the url so the default is forced. $this->drupalPostForm('block/add', $edit, t('Save')); // Check that the block has been created and that it is a basic block. @@ -112,7 +112,7 @@ public function testDefaultBlockContentCreation() { // Check that the block exists in the database. $blocks = entity_load_multiple_by_properties('block_content', array('info' => $edit['info[0][value]'])); $block = reset($blocks); - $this->assertTrue($block, 'Default Custom Block found in database.'); + $this->assertTrue($block, 'Default Block Content found in database.'); } /** @@ -187,7 +187,7 @@ public function testBlockDelete() { $this->assertText(format_plural(1, 'This will also remove 1 placed block instance.', 'This will also remove @count placed block instance.')); $this->drupalPostForm(NULL, array(), 'Delete'); - $this->assertRaw(t('Custom block %name has been deleted.', array('%name' => $edit['info[0][value]']))); + $this->assertRaw(t('Block content %name has been deleted.', array('%name' => $edit['info[0][value]']))); // Create another block and force the plugin cache to flush. $edit2 = array(); diff --git a/core/modules/block_content/src/Tests/BlockContentListTest.php b/core/modules/block_content/src/Tests/BlockContentListTest.php index 07a3299..f4f3ccc 100644 --- a/core/modules/block_content/src/Tests/BlockContentListTest.php +++ b/core/modules/block_content/src/Tests/BlockContentListTest.php @@ -10,7 +10,7 @@ use Drupal\simpletest\WebTestBase; /** - * Tests the listing of custom blocks. + * Tests the listing of block content. * * @group block_content * @see \Drupal\block\BlockContentListBuilder @@ -25,14 +25,14 @@ class BlockContentListTest extends WebTestBase { public static $modules = array('block', 'block_content', 'config_translation'); /** - * Tests the custom block listing page. + * Tests the block content listing page. */ public function testListing() { $this->drupalLogin($this->drupalCreateUser(array('administer blocks', 'translate configuration'))); $this->drupalGet('admin/structure/block/block-content'); // Test for the page title. - $this->assertTitle(t('Custom block library') . ' | Drupal'); + $this->assertTitle(t('Block content library') . ' | Drupal'); // Test for the table. $element = $this->xpath('//div[@class="layout-content"]//table'); @@ -51,7 +51,7 @@ public function testListing() { $label = 'Antelope'; $new_label = 'Albatross'; // Add a new entity using the operations link. - $link_text = t('Add custom block'); + $link_text = t('Add block content'); $this->assertLink($link_text); $this->clickLink($link_text); $this->assertResponse(200); @@ -82,7 +82,7 @@ public function testListing() { $this->assertLinkByHref('block/' . $block->id()); $this->clickLink(t('Edit')); $this->assertResponse(200); - $this->assertTitle(strip_tags(t('Edit custom block %label', array('%label' => $label)) . ' | Drupal')); + $this->assertTitle(strip_tags(t('Edit block content %label', array('%label' => $label)) . ' | Drupal')); $edit = array('info[0][value]' => $new_label); $this->drupalPostForm(NULL, $edit, t('Save')); } @@ -92,7 +92,7 @@ public function testListing() { // Confirm that once the user returns to the listing, the text of the label // (versus elsewhere on the page). - $this->assertFieldByXpath('//td', $new_label, 'Label found for updated custom block.'); + $this->assertFieldByXpath('//td', $new_label, 'Label found for updated block content.'); // Delete the added entity using the operations link. $this->assertLinkByHref('block/' . $block->id() . '/delete'); @@ -104,7 +104,7 @@ public function testListing() { // Verify that the text of the label and machine name does not appear in // the list (though it may appear elsewhere on the page). - $this->assertNoFieldByXpath('//td', $new_label, 'No label found for deleted custom block.'); + $this->assertNoFieldByXpath('//td', $new_label, 'No label found for deleted block content.'); // Confirm that the empty text is displayed. $this->assertText(t('There is no Custom Block yet.')); diff --git a/core/modules/block_content/src/Tests/BlockContentSaveTest.php b/core/modules/block_content/src/Tests/BlockContentSaveTest.php index f2a845b..1eb893a 100644 --- a/core/modules/block_content/src/Tests/BlockContentSaveTest.php +++ b/core/modules/block_content/src/Tests/BlockContentSaveTest.php @@ -33,10 +33,10 @@ protected function setUp() { } /** - * Checks whether custom block IDs are saved properly during an import. + * Checks whether block content IDs are saved properly during an import. */ public function testImport() { - // Custom block ID must be a number that is not in the database. + // Block content ID must be a number that is not in the database. $max_id = db_query('SELECT MAX(id) FROM {block_content}')->fetchField(); $test_id = $max_id + mt_rand(1000, 1000000); $info = $this->randomMachineName(8); @@ -55,7 +55,7 @@ public function testImport() { // Test the import saved. $block_by_id = BlockContent::load($test_id); - $this->assertTrue($block_by_id, 'Custom block load by block ID.'); + $this->assertTrue($block_by_id, 'Block content load by block ID.'); $this->assertIdentical($block_by_id->body->value, $block_array['body']['value']); } @@ -81,7 +81,7 @@ public function testDeterminingChanges() { // block_content_test_block_content_update() determine changes and change the // title as well as programatically set the 'changed' timestamp. $this->assertEqual($block->label(), 'updated_presave_update', 'Changes have been determined.'); - $this->assertEqual($block->getChangedTime(), 979534800, 'Saving a custom block uses "changed" timestamp set in presave hook.'); + $this->assertEqual($block->getChangedTime(), 979534800, 'Saving a block content uses "changed" timestamp set in presave hook.'); // Test the static block load cache to be cleared. $block = BlockContent::load($block->id()); @@ -101,7 +101,7 @@ public function testBlockContentSaveOnInsert() { // block_content_test_block_content_insert() triggers a save on insert if the // title equals 'new'. $block = $this->createBlockContent('new'); - $this->assertEqual($block->label(), 'BlockContent ' . $block->id(), 'Custom block saved on block insert.'); + $this->assertEqual($block->label(), 'BlockContent ' . $block->id(), 'Block content saved on block insert.'); } } diff --git a/core/modules/block_content/src/Tests/BlockContentTestBase.php b/core/modules/block_content/src/Tests/BlockContentTestBase.php index 5bb7122..d5fe7dc 100644 --- a/core/modules/block_content/src/Tests/BlockContentTestBase.php +++ b/core/modules/block_content/src/Tests/BlockContentTestBase.php @@ -51,7 +51,7 @@ protected function setUp() { } /** - * Creates a custom block. + * Creates a block content. * * @param string $title * (optional) Title of block. When no value is given uses a random name. @@ -60,7 +60,7 @@ protected function setUp() { * (optional) Bundle name. Defaults to 'basic'. * * @return \Drupal\block_content\Entity\BlockContent - * Created custom block. + * Created block content. */ protected function createBlockContent($title = FALSE, $bundle = 'basic') { $title = ($title ? : $this->randomMachineName()); @@ -75,13 +75,13 @@ protected function createBlockContent($title = FALSE, $bundle = 'basic') { } /** - * Creates a custom block type (bundle). + * Creates a block content type (bundle). * * @param string $label * The block type label. * * @return \Drupal\block_content\Entity\BlockContentType - * Created custom block type. + * Created block content type. */ protected function createBlockContentType($label) { $bundle = entity_create('block_content_type', array( diff --git a/core/modules/block_content/src/Tests/BlockContentTranslationUITest.php b/core/modules/block_content/src/Tests/BlockContentTranslationUITest.php index aec6f69..eb6b9c5 100644 --- a/core/modules/block_content/src/Tests/BlockContentTranslationUITest.php +++ b/core/modules/block_content/src/Tests/BlockContentTranslationUITest.php @@ -53,7 +53,7 @@ public function getTranslatorPermissions() { } /** - * Creates a custom block. + * Creates a block content. * * @param string $title * (optional) Title of block. When no value is given uses a random name. @@ -63,7 +63,7 @@ public function getTranslatorPermissions() { * $this->bundle. Defaults to FALSE. * * @return \Drupal\block_content\Entity\BlockContent - * Created custom block. + * Created block content. */ protected function createBlockContent($title = FALSE, $bundle = FALSE) { $title = ($title ? : $this->randomMachineName()); diff --git a/core/modules/block_content/src/Tests/BlockContentTypeTest.php b/core/modules/block_content/src/Tests/BlockContentTypeTest.php index 76dfdb7..cd35308 100644 --- a/core/modules/block_content/src/Tests/BlockContentTypeTest.php +++ b/core/modules/block_content/src/Tests/BlockContentTypeTest.php @@ -8,7 +8,7 @@ namespace Drupal\block_content\Tests; /** - * Ensures that custom block type functions work correctly. + * Ensures that block content type functions work correctly. * * @group block_content */ @@ -112,7 +112,7 @@ public function testBlockContentTypeDeletion() { // Attempt to delete the block type, which should not be allowed. $this->drupalGet('admin/structure/block/block-content/manage/' . $type->id() . '/delete'); $this->assertRaw( - t('%label is used by 1 custom block on your site. You can not remove this block type until you have removed all of the %label blocks.', array('%label' => $type->label())), + t('%label is used by 1 block content on your site. You can not remove this block type until you have removed all of the %label blocks.', array('%label' => $type->label())), 'The block type will not be deleted until all blocks of that type are removed.' ); $this->assertNoText(t('This action cannot be undone.'), 'The node type deletion confirmation form is not available.'); @@ -125,7 +125,7 @@ public function testBlockContentTypeDeletion() { t('Are you sure you want to delete %type?', array('%type' => $type->id())), 'The block type is available for deletion.' ); - $this->assertText(t('This action cannot be undone.'), 'The custom block type deletion confirmation form is available.'); + $this->assertText(t('This action cannot be undone.'), 'The block content type deletion confirmation form is available.'); } /** @@ -137,7 +137,7 @@ public function testsBlockContentAddTypes() { $type = $this->createBlockContentType('foo'); $type = $this->createBlockContentType('bar'); - // Get the custom block storage. + // Get the block content storage. $storage = $this->container ->get('entity.manager') ->getStorage('block_content'); @@ -158,7 +158,7 @@ public function testsBlockContentAddTypes() { // block configure form. $path = $theme == $default_theme ? 'admin/structure/block' : "admin/structure/block/list/$theme"; $this->drupalGet($path); - $this->clickLink(t('Add custom block')); + $this->clickLink(t('Add block content')); // The seven theme has markup inside the link, we cannot use clickLink(). if ($default_theme == 'seven') { $options = $theme != $default_theme ? array('query' => array('theme' => $theme)) : array(); @@ -184,10 +184,10 @@ public function testsBlockContentAddTypes() { } } - // Test that adding a block from the 'custom blocks list' doesn't send you + // Test that adding a block from the 'block content list' doesn't send you // to the block configure form. $this->drupalGet('admin/structure/block/block-content'); - $this->clickLink(t('Add custom block')); + $this->clickLink(t('Add block content')); $this->clickLink('foo'); $edit = array('info[0][value]' => $this->randomMachineName(8)); $this->drupalPostForm(NULL, $edit, t('Save')); diff --git a/core/modules/block_content/src/Tests/PageEditTest.php b/core/modules/block_content/src/Tests/PageEditTest.php index 3577547..1576e95 100644 --- a/core/modules/block_content/src/Tests/PageEditTest.php +++ b/core/modules/block_content/src/Tests/PageEditTest.php @@ -32,7 +32,7 @@ public function testPageEdit() { // Check that the block exists in the database. $blocks = \Drupal::entityQuery('block_content')->condition('info', $edit['info[0][value]'])->execute(); $block = entity_load('block_content', reset($blocks)); - $this->assertTrue($block, 'Custom block found in database.'); + $this->assertTrue($block, 'Block content found in database.'); // Load the edit page. $this->drupalGet('block/' . $block->id()); diff --git a/core/modules/block_content/templates/block-content-add-list.html.twig b/core/modules/block_content/templates/block-content-add-list.html.twig index e5a5d97..25f9f14 100644 --- a/core/modules/block_content/templates/block-content-add-list.html.twig +++ b/core/modules/block_content/templates/block-content-add-list.html.twig @@ -1,13 +1,13 @@ {# /** * @file - * Default theme implementation to present a list of custom block types. + * Default theme implementation to present a list of block content types. * * Available variables: - * - types: A collection of all the available custom block types. + * - types: A collection of all the available block content types. * Each block type contains the following: * - link: A link to add a block of this type. - * - description: A description of this custom block type. + * - description: A description of this block content type. * * @see template_preprocess_block_content_add_list() * diff --git a/core/modules/block_content/tests/modules/block_content_test/block_content_test.info.yml b/core/modules/block_content/tests/modules/block_content_test/block_content_test.info.yml index 747efa4..33d3877 100644 --- a/core/modules/block_content/tests/modules/block_content_test/block_content_test.info.yml +++ b/core/modules/block_content/tests/modules/block_content_test/block_content_test.info.yml @@ -1,6 +1,6 @@ -name: "Custom Block module tests" +name: "Block Content module tests" type: module -description: "Support module for custom block related testing." +description: "Support module for block content related testing." package: Testing version: VERSION core: 8.x diff --git a/core/modules/block_content/tests/modules/block_content_test/block_content_test.module b/core/modules/block_content/tests/modules/block_content_test/block_content_test.module index d714cb2..5fe791e 100644 --- a/core/modules/block_content/tests/modules/block_content_test/block_content_test.module +++ b/core/modules/block_content/tests/modules/block_content_test/block_content_test.module @@ -2,9 +2,9 @@ /** * @file - * A dummy module for testing custom block related hooks. + * A dummy module for testing block content related hooks. * - * This is a dummy module that implements custom block related hooks to test API + * This is a dummy module that implements block content related hooks to test API * interaction with the block_content module. */