Skip to content
Snippets Groups Projects
Commit e89fbf33 authored by Alex Pott's avatar Alex Pott
Browse files

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

parent ca484d92
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment