From e89fbf339d2361153721246c6b431d6de0c368a5 Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Mon, 17 Jun 2013 01:15:17 +0200 Subject: [PATCH] Issue #2019469 by clemens.tolboom: Tour module should use token for it's body. --- .../tour/lib/Drupal/tour/Plugin/tour/tip/TipPluginText.php | 2 +- core/modules/tour/lib/Drupal/tour/Tests/TourTest.php | 7 +++++++ .../tour/tests/tour_test/config/tour.tour.tour-test.yml | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/core/modules/tour/lib/Drupal/tour/Plugin/tour/tip/TipPluginText.php b/core/modules/tour/lib/Drupal/tour/Plugin/tour/tip/TipPluginText.php index 8f6d40cf689..cb93887e566 100644 --- a/core/modules/tour/lib/Drupal/tour/Plugin/tour/tip/TipPluginText.php +++ b/core/modules/tour/lib/Drupal/tour/Plugin/tour/tip/TipPluginText.php @@ -83,7 +83,7 @@ class TipPluginText extends TipPluginBase { */ public function getOutput() { $output = '

' . check_plain($this->getLabel()) . '

'; - $output .= '

' . filter_xss_admin($this->getBody()) . '

'; + $output .= '

' . \Drupal::token()->replace(filter_xss_admin($this->getBody())) . '

'; return array('#markup' => $output); } } diff --git a/core/modules/tour/lib/Drupal/tour/Tests/TourTest.php b/core/modules/tour/lib/Drupal/tour/Tests/TourTest.php index d3c77da5d05..a8e7b8a3d5f 100644 --- a/core/modules/tour/lib/Drupal/tour/Tests/TourTest.php +++ b/core/modules/tour/lib/Drupal/tour/Tests/TourTest.php @@ -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', diff --git a/core/modules/tour/tests/tour_test/config/tour.tour.tour-test.yml b/core/modules/tour/tests/tour_test/config/tour.tour.tour-test.yml index 86abd83d19a..31dd41148d0 100644 --- a/core/modules/tour/tests/tour_test/config/tour.tour.tour-test.yml +++ b/core/modules/tour/tests/tour_test/config/tour.tour.tour-test.yml @@ -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