commit 6011e6d031753aceb79340718e27ca197c8a31a5 Author: xjm Date: Sun Jan 6 20:51:44 2013 -0600 28 diff --git a/core/modules/block/block.module b/core/modules/block/block.module index 7ec818b..84f0d83 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -524,7 +524,7 @@ function _block_load_blocks() { // Ignore blocks belonging to disabled modules, but re-throw valid // exceptions when the module is enabled and the plugin is misconfigured. if (empty($config['module']) || module_exists($config['module'])) { - throw new PluginException(sprintf('The plugin %s was not found.', $plugin_id)); + throw new PluginException(format_string('The plugin @name was not found.', array('@name' => $plugin_id))); } } } diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php index 7928fa9..88df26d 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php @@ -400,6 +400,10 @@ function testBlockModuleDisable() { $block['region'] = 'header'; $this->drupalPost('admin/structure/block/manage/' . $block['id'] . '/' . $block['theme'], array('machine_name' => $block['machine_name'], 'region' => $block['region']), t('Save block')); + // Confirm that the block is displayed on the front page. + $this->drupalGet(''); + $this->assertText('Test block caching'); + // Disable the block test module and refresh the definitions cache. module_disable(array('block_test'), FALSE); $manager->clearCachedDefinitions(); @@ -416,6 +420,33 @@ function testBlockModuleDisable() { // Ensure that the disabled module's block plugin is no longer available. $this->drupalGet('admin/structure/block/list/block_plugin_ui:' . variable_get('theme_default', 'stark') . '/add'); $this->assertNoText(t('Test block caching')); + + // Confirm that the block is no longer displayed on the front page. + $this->drupalGet(''); + $this->assertResponse(200); + $this->assertNoText('Test block caching'); + + // Confirm that a different block instance can still be enabled. + $block_id = 'system_powered_by_block'; + $edit = array( + 'title' => $this->randomName(8), + 'machine_name' => $this->randomName(8), + 'region' => 'sidebar_first', + ); + $this->drupalPost('admin/structure/block/manage/' . $block_id . '/stark', $edit, t('Save block')); + $this->assertText(t('The block configuration has been saved.')); + + // Re-enable the module and refresh the definitions cache. + module_enable(array('block_test'), FALSE); + $manager->clearCachedDefinitions(); + + // Reload the admin page and confirm the block can again be configured. + $this->drupalGet('admin/structure/block'); + $this->assertLinkByHref(url('admin/structure/block/manage/plugin.core.block.stark.' . $edit['machine_name'] . '/stark/config')); + + // Confirm that the block is again displayed on the front page. + $this->drupalGet(''); + $this->assertText('Test block caching'); } }