From 87bfe3ee09681aca18608f65cbaa9841ce6fa3c7 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Thu, 1 Aug 2013 23:50:33 +0100 Subject: [PATCH] mw.ViewPageTarget.init: Fix pageExists/isViewPage behaviour "Let me clarify this for you" - Timo Follows-up 1984c3ca46cceb. Bug: 49000 Change-Id: Ia094aa9aae1da1ba11dbaef827e305cbcf08f9b4 --- modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.init.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.init.js b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.init.js index eafd735424..ec2760c159 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.init.js +++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.init.js @@ -53,13 +53,12 @@ conf = mw.config.get( 'wgVisualEditorConfig' ); uri = new mw.Uri(); - // For non-article pages, no information about page existence is exposed to + // For special pages, no information about page existence is exposed to // mw.config, so we assume it exists TODO: fix this in core. - pageExists = !!mw.config.get( 'wgArticleId' ) || !mw.config.get( 'wgIsArticle' ); + pageExists = !!mw.config.get( 'wgArticleId' ) || mw.config.get( 'wgNamespaceNumber' ) < 0; viewUri = new mw.Uri( mw.util.wikiGetlink( mw.config.get( 'wgRelevantPageName' ) ) ); veEditUri = viewUri.clone().extend( { 'veaction': 'edit' } ); isViewPage = ( - mw.config.get( 'wgAction' ) === 'view' && mw.config.get( 'wgIsArticle' ) && !( 'diff' in uri.query ) );