Ejegg has submitted this change and it was merged.

Change subject: Clean up
......................................................................


Clean up

Change-Id: I82b56654cedd1455267006063269fb4e034fa0a2
---
M sites/all/modules/thank_you/generators/FindUnconsumedTokens.php
M sites/all/modules/thank_you/generators/RenderTranslatedPage.php
2 files changed, 9 insertions(+), 5 deletions(-)

Approvals:
  Ejegg: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/sites/all/modules/thank_you/generators/FindUnconsumedTokens.php 
b/sites/all/modules/thank_you/generators/FindUnconsumedTokens.php
index 3c40110..d309534 100644
--- a/sites/all/modules/thank_you/generators/FindUnconsumedTokens.php
+++ b/sites/all/modules/thank_you/generators/FindUnconsumedTokens.php
@@ -33,11 +33,14 @@
             'first_name' => 'fix',
             'last_name' => 'me',
             'recurring' => true,
-            'RecurringRestarted' => true,
 
             'receive_date' => time(),
 
             'locale' => $locale,
+            'contribution_tags' => array(
+                "RecurringRestarted",
+                "UnrecordedCharge",
+            ),
         );
         return $params;
     }
@@ -61,8 +64,9 @@
      * @throws UnconsumedTokenException
      */
     static function renderAndFindTokens( $template, $locale ) {
-        $rendered = Templating::renderStringTemplate( $template, 
FindUnconsumedTokens::getRandomTemplateParams( $locale ) );
-        FindUnconsumedTokens::findTokens( $buf );
+        $params = FindUnconsumedTokens::getRandomTemplateParams( $locale );
+        $rendered = Templating::renderStringTemplate( $template, $params );
+        FindUnconsumedTokens::findTokens( $rendered );
     }
 
     /**
@@ -87,7 +91,7 @@
         if ( $count = preg_match_all( $bad_punctuation_re, $buf, $matches ) ) {
             $bad_punc = implode( ', ', $matches[0] );
             throw new UnconsumedTokenException(
-                "Found {$count} likely tokens [{$bad_punc}] in rendered 
thank-you translation." );
+                "Found {$count} likely tokens \"{$bad_punc}\" in rendered 
thank-you translation." );
         }
     }
 }
diff --git a/sites/all/modules/thank_you/generators/RenderTranslatedPage.php 
b/sites/all/modules/thank_you/generators/RenderTranslatedPage.php
index c6cf93e..d7c70b5 100644
--- a/sites/all/modules/thank_you/generators/RenderTranslatedPage.php
+++ b/sites/all/modules/thank_you/generators/RenderTranslatedPage.php
@@ -51,11 +51,11 @@
                                // Make it nicer to read
                                $page_content = str_replace( '|</p>|', 
"</p>\n", $page_content );
 
-                               $file = str_replace( '$1', $lang, 
$this->proto_file );
 
                                // Assert no garbage
                                FindUnconsumedTokens::renderAndFindTokens( 
$page_content, $lang );
 
+                               $file = str_replace( '$1', $lang, 
$this->proto_file );
                                $template_name = basename( $file );
 
                                $template_info = array(

-- 
To view, visit https://gerrit.wikimedia.org/r/161616
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I82b56654cedd1455267006063269fb4e034fa0a2
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Awight <awi...@wikimedia.org>
Gerrit-Reviewer: Awight <awi...@wikimedia.org>
Gerrit-Reviewer: Ejegg <eeggles...@wikimedia.org>
Gerrit-Reviewer: Katie Horn <kh...@wikimedia.org>
Gerrit-Reviewer: Ssmith <ssm...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to