diff --git a/core/modules/block/block.module b/core/modules/block/block.module index 183462e111c0b5dbf7c4368072cd31f24d89b5ab..5190436457635a33b50c41dbde294305c784f02c 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -62,7 +62,7 @@ function block_help($path, $arg) { } $themes = list_themes(); $output = '

' . t('This page provides a drag-and-drop interface for adding a block to a region, and for controlling the order of blocks within regions. To add a block to a region, or to configure its specific title and visibility settings, click the block title under Place blocks. Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the Save blocks button at the bottom of the page.') . '

'; - $output .= '

' . l(t('Demonstrate block regions (@theme)', array('@theme' => $themes[$demo_theme]->info['name'])), 'admin/structure/block/demo/' . $demo_theme) . '

'; + $output .= '

' . l(t('Demonstrate block regions (!theme)', array('!theme' => $themes[$demo_theme]->info['name'])), 'admin/structure/block/demo/' . $demo_theme) . '

'; return $output; } } diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php index 37074ccb619a14308cbefe3bef15e4d2b4210b30..1a0fd00206f8febb82e3701f687c5c6e1c389a1e 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php @@ -181,6 +181,26 @@ public function testBlockThemeSelector() { } } + /** + * Test block display of theme titles. + */ + function testThemeName() { + \Drupal::moduleHandler()->install(array('block_test')); + // Explicitly set the default and admin themes. + $theme = 'cat_mouse'; + theme_enable(array($theme, 'seven', 'block_test_theme')); + $this->resetAll(); + + \Drupal::config('system.theme') + ->set('default', 'seven') + ->set('admin', 'seven') + ->save(); + \Drupal::service('router.builder')->rebuild(); + $this->drupalGet('admin/appearance'); + $this->drupalGet('admin/structure/block'); + $this->assertText('<"Cat" & 'Mouse'>'); + } + /** * Test block title display settings. */ diff --git a/core/modules/block/tests/modules/block_test/block_test.module b/core/modules/block/tests/modules/block_test/block_test.module index a527ae1ddeec16fef9739a5881e226256f68e3a2..726043c17bf2979c5d16a189b662cb19b55a7a39 100644 --- a/core/modules/block/tests/modules/block_test/block_test.module +++ b/core/modules/block/tests/modules/block_test/block_test.module @@ -7,6 +7,15 @@ use Drupal\block\BlockPluginInterface; +/** + * Implements hook_system_theme_info(). + */ +function block_test_system_theme_info() { + $themes['block_test_theme'] = drupal_get_path('module', 'block_test') . '/themes/block_test_theme/block_test_theme.info.yml'; + $themes['cat_mouse'] = drupal_get_path('module', 'block_test') . '/themes/cat_mouse/cat_mouse.info.yml'; + return $themes; +} + /** * Implements hook_block_alter(). */ diff --git a/core/modules/block/tests/modules/block_test/themes/cat_mouse/cat_mouse.info.yml b/core/modules/block/tests/modules/block_test/themes/cat_mouse/cat_mouse.info.yml new file mode 100644 index 0000000000000000000000000000000000000000..999f7f3b3caef42480f6e175ff7f66139754819f --- /dev/null +++ b/core/modules/block/tests/modules/block_test/themes/cat_mouse/cat_mouse.info.yml @@ -0,0 +1,16 @@ +name: '<"Cat" & ''Mouse''>' +type: theme +description: 'Theme for testing special characters in block admin.' +core: 8.x +hidden: true +regions: + sidebar_first: 'Left sidebar' + sidebar_second: 'Right sidebar' + content: Content + header: Header + footer: Footer + highlighted: Highlighted + help: Help +regions_hidden: + - sidebar_first + - sidebar_second