Robmoen has uploaded a new change for review.

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

Change subject: Watchstar and tutorial were throwing error on special pages
......................................................................

Watchstar and tutorial were throwing error on special pages

Due to the lack of wgCollections. Solution is to not
attempt to show the tutorial or watchstar on special pages

Change-Id: I2cf1d4c0e1b99331220693a79d1a9923fce96d19
---
M resources/ext.gather.watchstar/init.js
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Gather 
refs/changes/70/199170/1

diff --git a/resources/ext.gather.watchstar/init.js 
b/resources/ext.gather.watchstar/init.js
index 21891c6..78bbd98 100644
--- a/resources/ext.gather.watchstar/init.js
+++ b/resources/ext.gather.watchstar/init.js
@@ -78,8 +78,12 @@
         * @ignore
         */
        function init( page ) {
-               var shouldShow = shouldShowCollectionTutorial(),
+               var pageIsArticle = !page.inNamespace( 'special' ),
+                       shouldShow = pageIsArticle ? 
shouldShowCollectionTutorial() : false,
                        $star = $( '#ca-watch' ),
+                       watchstar;
+
+               if ( pageIsArticle ) {
                        watchstar = new CollectionsWatchstar( {
                                el: $star,
                                page: page,
@@ -88,7 +92,6 @@
                                collections: mw.config.get( 
'wgGatherCollections' ),
                                isNewlyAuthenticatedUser: 
mw.util.getParamValue( 'article_action' ) === 'add_to_collection'
                        } );
-               if ( !page.inNamespace( 'special' ) ) {
                        // Determine if we should show the collection tutorial
                        if ( $star.length > 0 && shouldShow ) {
                                // FIXME: Timeout shouldn't be necessary but 
T91047 exists.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2cf1d4c0e1b99331220693a79d1a9923fce96d19
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Gather
Gerrit-Branch: master
Gerrit-Owner: Robmoen <[email protected]>

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

Reply via email to