Commit e89fbf33 authored by alexpott's avatar alexpott
Browse files

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

parent ca484d92
......@@ -83,7 +83,7 @@ public function getAttributes() {
*/
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);
}
}
......@@ -49,6 +49,13 @@ public function testTourFunctionality() {
));
$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',
......
......@@ -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
......
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