Awight has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/161617

Change subject: Bizarre bugfix
......................................................................

Bizarre bugfix

I don't understand the bug, but the Twig parser is suddenly rejecting
"endif" tags, picking up an extra space for some reason, but only in some
contexts.  This patch works around the bug for now.

Change-Id: I5751559dc358505876483362a96d725a9f0a9a48
---
M sites/all/modules/thank_you/generators/RenderTranslatedPage.php
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/17/161617/1

diff --git a/sites/all/modules/thank_you/generators/RenderTranslatedPage.php 
b/sites/all/modules/thank_you/generators/RenderTranslatedPage.php
index d7c70b5..f3db390 100644
--- a/sites/all/modules/thank_you/generators/RenderTranslatedPage.php
+++ b/sites/all/modules/thank_you/generators/RenderTranslatedPage.php
@@ -51,6 +51,9 @@
                                // Make it nicer to read
                                $page_content = str_replace( '|</p>|', 
"</p>\n", $page_content );
 
+// WTF: We're suddenly getting strange errors about the unknown 'endif ' tag.
+// So, strip spaces....
+$page_content = preg_replace( '/{%[^%]*endif[^%]*%}/sm', '{%endif%}', 
$page_content );
 
                                // Assert no garbage
                                FindUnconsumedTokens::renderAndFindTokens( 
$page_content, $lang );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5751559dc358505876483362a96d725a9f0a9a48
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Awight <awi...@wikimedia.org>

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

Reply via email to