Issue #2019469 by clemens.tolboom: Tour module should use token for it's body.

8.0.x
Alex Pott 2013-06-17 01:15:17 +02:00
parent ca484d92c1
commit e89fbf339d
3 changed files with 9 additions and 2 deletions

View File

@ -83,7 +83,7 @@ class TipPluginText extends TipPluginBase {
*/
public function getOutput() {
$output = '<h2 class="tour-tip-label" id="tour-tip-' . $this->getAriaId() . '-label">' . check_plain($this->getLabel()) . '</h2>';
$output .= '<p class="tour-tip-body" id="tour-tip-' . $this->getAriaId() . '-contents">' . filter_xss_admin($this->getBody()) . '</p>';
$output .= '<p class="tour-tip-body" id="tour-tip-' . $this->getAriaId() . '-contents">' . \Drupal::token()->replace(filter_xss_admin($this->getBody())) . '</p>';
return array('#markup' => $output);
}
}

View File

@ -49,6 +49,13 @@ class TourTest extends WebTestBase {
));
$this->assertEqual(count($elements), 1, 'Found English variant of tip 1.');
$elements = $this->xpath('//li[@data-id=:data_id and @class=:classes and ./p[contains(., :text)]]', array(
':classes' => 'tip-module-tour-test tip-type-text tip-tour-test-1 even last',
':data_id' => 'tour-test-1',
':text' => 'Is Drupal always the best dressed?',
));
$this->assertEqual(count($elements), 1, 'Found Token replacement.');
$elements = $this->xpath('//li[@data-id=:data_id and ./h2[contains(., :text)]]', array(
':data_id' => 'tour-test-2',
':text' => 'The quick brown fox',

View File

@ -9,7 +9,7 @@ tips:
id: tour-test-1
plugin: text
label: The first tip
body: Is always the best dressed.
body: Is [site:name] always the best dressed?
weight: "1"
attributes:
data-id: tour-test-1