jenkins-bot has submitted this change and it was merged.

Change subject: Update mock wgEchoConfig to also run on 
Special:JavaScript/qunit/plain
......................................................................


Update mock wgEchoConfig to also run on Special:JavaScript/qunit/plain

Follows-up 8d12ef9.

Tests were failing because wgEchoConfig was undefined and ext.base.js
accesses wgEchoConfig.eventlogging.

This mock should not be needed. Modules should be loadable at any
time and react to the current environment. If they should not do
anything, the client should be able to determine that. Perhaps
an isAnon() or some property wgEchoConfig to indicate this.

It only being loaded from beforePageDisplay() when logged-in is a
load optimisation, not business logic. wgEchoConfig should always
be there, or the code should handle the case of it not being there.

Change-Id: Ide90adf20e583921c9f3bd5cd37057995aa3d2c3
---
M Hooks.php
1 file changed, 5 insertions(+), 1 deletion(-)

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



diff --git a/Hooks.php b/Hooks.php
index c048399..053a4d3 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -771,7 +771,11 @@
                        );
                        $vars['wgEchoHelpPage'] = $wgEchoHelpPage;
                        $vars['wgEchoConfig'] = $wgEchoConfig;
-               } else if ( SpecialPage::getTitleFor( 'JavaScriptTest', 'qunit' 
)->equals( $outputPage->getTitle() ) ) {
+               } else if (
+                       $outputPage->getTitle()->equals( 
SpecialPage::getTitleFor( 'JavaScriptTest', 'qunit' ) ) ||
+                       // Also if running from /plain or /export
+                       $outputPage->getTitle()->isSubpageOf( 
SpecialPage::getTitleFor( 'JavaScriptTest', 'qunit' ) )
+               ) {
                        // For testing purposes
                        $vars['wgEchoConfig'] = array(
                                'eventlogging' => array(

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ide90adf20e583921c9f3bd5cd37057995aa3d2c3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to