Commit 0a85def4 authored by webchick's avatar webchick

Issue #214760 by Jalandhar, lokapujya, dcam, naquah: Theme name in block admin...

Issue #214760 by Jalandhar, lokapujya, dcam, naquah: Theme name in block admin shows HTML entities: excessive check_plain().
parent bd4b9ae2
...@@ -62,7 +62,7 @@ function block_help($path, $arg) { ...@@ -62,7 +62,7 @@ function block_help($path, $arg) {
} }
$themes = list_themes(); $themes = list_themes();
$output = '<p>' . 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 <em>Place blocks</em>. 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 <em>Save blocks</em> button at the bottom of the page.') . '</p>'; $output = '<p>' . 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 <em>Place blocks</em>. 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 <em>Save blocks</em> button at the bottom of the page.') . '</p>';
$output .= '<p>' . l(t('Demonstrate block regions (@theme)', array('@theme' => $themes[$demo_theme]->info['name'])), 'admin/structure/block/demo/' . $demo_theme) . '</p>'; $output .= '<p>' . l(t('Demonstrate block regions (!theme)', array('!theme' => $themes[$demo_theme]->info['name'])), 'admin/structure/block/demo/' . $demo_theme) . '</p>';
return $output; return $output;
} }
} }
......
...@@ -181,6 +181,26 @@ public function testBlockThemeSelector() { ...@@ -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('&lt;&quot;Cat&quot; &amp; &#039;Mouse&#039;&gt;');
}
/** /**
* Test block title display settings. * Test block title display settings.
*/ */
......
...@@ -7,6 +7,15 @@ ...@@ -7,6 +7,15 @@
use Drupal\block\BlockPluginInterface; 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(). * Implements hook_block_alter().
*/ */
......
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment