Krinkle has uploaded a new change for review.

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

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/59/198459/1

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: newchange
Gerrit-Change-Id: Ide90adf20e583921c9f3bd5cd37057995aa3d2c3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Krinkle <krinklem...@gmail.com>

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

Reply via email to