Merge "Fix possible error list of action=revisiondelete"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 21 Mar 2014 10:39:33 +0000 (10:39 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 21 Mar 2014 10:39:33 +0000 (10:39 +0000)
12 files changed:
includes/EditPage.php
includes/api/ApiQueryAllImages.php
includes/api/ApiQueryStashImageInfo.php
includes/specials/SpecialWhatlinkshere.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
maintenance/language/messageTypes.inc
skins/CologneBlue.php
skins/monobook/IE60Fixes.css
skins/monobook/main.css
tests/phpunit/skins/SideBarTest.php
tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js

index 5f5cb53..3b2f179 100644 (file)
@@ -2082,10 +2082,27 @@ class EditPage {
                }
                # Try to add a custom edit intro, or use the standard one if this is not possible.
                if ( !$this->showCustomIntro() && !$this->mTitle->exists() ) {
+                       $helpLink = Skin::makeInternalOrExternalUrl(
+                               wfMessage( 'helppage' )->inContentLanguage()->text()
+                       );
                        if ( $wgUser->isLoggedIn() ) {
-                               $wgOut->wrapWikiMsg( "<div class=\"mw-newarticletext\">\n$1\n</div>", 'newarticletext' );
+                               $wgOut->wrapWikiMsg(
+                                       // Suppress the external link icon, consider the help url an internal one
+                                       "<div class=\"mw-newarticletext plainlinks\">\n$1\n</div>",
+                                       array(
+                                               'newarticletext',
+                                               $helpLink
+                                       )
+                               );
                        } else {
-                               $wgOut->wrapWikiMsg( "<div class=\"mw-newarticletextanon\">\n$1\n</div>", 'newarticletextanon' );
+                               $wgOut->wrapWikiMsg(
+                                       // Suppress the external link icon, consider the help url an internal one
+                                       "<div class=\"mw-newarticletextanon plainlinks\">\n$1\n</div>",
+                                       array(
+                                               'newarticletextanon',
+                                               $helpLink
+                                       )
+                               );
                        }
                }
                # Give a notice if the user is editing a deleted/moved page...
index 0591fa9..6e2c31f 100644 (file)
@@ -378,7 +378,7 @@ class ApiQueryAllImages extends ApiQueryGeneratorBase {
                );
        }
 
-       private $propertyFilter = array( 'archivename', 'thumbmime' );
+       private $propertyFilter = array( 'archivename', 'thumbmime', 'uploadwarning' );
 
        public function getResultProperties() {
                return array_merge(
index 3595cf9..6a49e60 100644 (file)
@@ -72,7 +72,7 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo {
 
        private $propertyFilter = array(
                'user', 'userid', 'comment', 'parsedcomment',
-               'mediatype', 'archivename',
+               'mediatype', 'archivename', 'uploadwarning',
        );
 
        public function getAllowedParams() {
index 789ea76..176fbd4 100644 (file)
@@ -26,7 +26,7 @@
  *
  * @ingroup SpecialPage
  */
-class SpecialWhatLinksHere extends SpecialPage {
+class SpecialWhatLinksHere extends IncludableSpecialPage {
 
        /**
         * @var FormOptions
@@ -88,9 +88,7 @@ class SpecialWhatLinksHere extends SpecialPage {
 
                $out->setPageTitle( $this->msg( 'whatlinkshere-title', $this->target->getPrefixedText() ) );
                $out->addBacklinkSubtitle( $this->target );
-
-               $this->showIndirectLinks( 0, $this->target, $opts->getValue( 'limit' ),
-                       $opts->getValue( 'from' ), $opts->getValue( 'back' ) );
+               $this->showIndirectLinks( 0, $this->target, $opts->getValue( 'limit' ), $opts->getValue( 'from' ), $opts->getValue( 'back' ) );
        }
 
        /**
@@ -188,15 +186,16 @@ class SpecialWhatLinksHere extends SpecialPage {
 
                if ( ( !$fetchlinks || !$plRes->numRows() ) && ( $hidetrans || !$tlRes->numRows() ) && ( $hideimages || !$ilRes->numRows() ) ) {
                        if ( 0 == $level ) {
-                               $out->addHTML( $this->whatlinkshereForm() );
-
-                               // Show filters only if there are links
-                               if ( $hidelinks || $hidetrans || $hideredirs || $hideimages ) {
-                                       $out->addHTML( $this->getFilterPanel() );
+                               if ( !$this->including() ) {
+                                       $out->addHTML( $this->whatlinkshereForm() );
+
+                                       // Show filters only if there are links
+                                       if ( $hidelinks || $hidetrans || $hideredirs || $hideimages ) {
+                                               $out->addHTML( $this->getFilterPanel() );
+                                       }
+                                       $errMsg = is_int( $namespace ) ? 'nolinkshere-ns' : 'nolinkshere';
+                                       $out->addWikiMsg( $errMsg, $this->target->getPrefixedText() );
                                }
-
-                               $errMsg = is_int( $namespace ) ? 'nolinkshere-ns' : 'nolinkshere';
-                               $out->addWikiMsg( $errMsg, $this->target->getPrefixedText() );
                        }
                        return;
                }
@@ -246,14 +245,15 @@ class SpecialWhatLinksHere extends SpecialPage {
                $prevId = $from;
 
                if ( $level == 0 ) {
-                       $out->addHTML( $this->whatlinkshereForm() );
-                       $out->addHTML( $this->getFilterPanel() );
-                       $out->addWikiMsg( 'linkshere', $this->target->getPrefixedText() );
+                       if ( !$this->including() ) {
+                               $out->addHTML( $this->whatlinkshereForm() );
+                               $out->addHTML( $this->getFilterPanel() );
+                               $out->addWikiMsg( 'linkshere', $this->target->getPrefixedText() );
 
-                       $prevnext = $this->getPrevNext( $prevId, $nextId );
-                       $out->addHTML( $prevnext );
+                               $prevnext = $this->getPrevNext( $prevId, $nextId );
+                               $out->addHTML( $prevnext );
+                       }
                }
-
                $out->addHTML( $this->listStart( $level ) );
                foreach ( $rows as $row ) {
                        $nt = Title::makeTitle( $row->page_namespace, $row->page_title );
@@ -270,7 +270,9 @@ class SpecialWhatLinksHere extends SpecialPage {
                $out->addHTML( $this->listEnd() );
 
                if ( $level == 0 ) {
-                       $out->addHTML( $prevnext );
+                       if( !$this->including() ){
+                               $out->addHTML( $prevnext );
+                       }
                }
        }
 
index a00d2df..222333b 100644 (file)
@@ -654,6 +654,7 @@ future releases. Also note that since each list value is wrapped in a unique
 ** mainpage|mainpage-description
 ** recentchanges-url|recentchanges
 ** randompage-url|randompage
+** helppage|help
 * SEARCH
 * TOOLBOX
 * LANGUAGES', # do not translate or duplicate this message to other languages
@@ -913,7 +914,7 @@ $1',
 'disclaimerpage'       => 'Project:General disclaimer',
 'edithelp'             => 'Editing help',
 'edithelppage'         => 'https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Editing_pages', # do not translate or duplicate this message to other languages
-'helppage'             => 'Help:Contents',
+'helppage'             => 'https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents',
 'mainpage'             => 'Main Page',
 'mainpage-description' => 'Main page',
 'policy-url'           => 'Project:Policy',
@@ -1446,9 +1447,9 @@ It may have been moved or deleted while you were viewing the page.',
 'accmailtext'                              => 'A randomly generated password for [[User talk:$1|$1]] has been sent to $2. It can be changed on the <em>[[Special:ChangePassword|change password]]</em> page upon logging in.',
 'newarticle'                               => '(New)',
 'newarticletext'                           => "You have followed a link to a page that does not exist yet.
-To create the page, start typing in the box below (see the [[{{MediaWiki:Helppage}}|help page]] for more info).
+To create the page, start typing in the box below (see the [$1 help page] for more info).
 If you are here by mistake, click your browser's <strong>back</strong> button.",
-'newarticletextanon'                       => '{{int:newarticletext}}', # do not translate or duplicate this message to other languages
+'newarticletextanon'                       => '{{int:newarticletext|$1}}', # do not translate or duplicate this message to other languages
 'talkpagetext'                             => '<!-- MediaWiki:talkpagetext -->', # do not translate or duplicate this message to other languages
 'anontalkpagetext'                         => '----
 <em>This is the discussion page for an anonymous user who has not created an account yet, or who does not use it.</em>
index b97ce8c..f3c762c 100644 (file)
@@ -1952,10 +1952,9 @@ Parameters:
 * $1 - username
 * $2 - email address",
 'newarticle' => '{{Identical|New}}',
-'newarticletext' => '{{doc-important|Do not translate <code><nowiki>{{MediaWiki:Helppage}}</nowiki></code>.}}
-Text displayed above the edit box in editor when trying to create a new page.
-
-Refers to {{msg-mw|Helppage}}.',
+'newarticletext' => "Text displayed above the edit box in editor when trying to create a new page.
+Parameters:
+* $1 - The URL to the help page, defined in {{msg-mw|helppage}}",
 'anontalkpagetext' => 'Displayed at the bottom of talk pages of anonymous users.',
 'noarticletext' => 'This is the message that you get if you search for a term that has not yet got any entries on the wiki.
 
index 6cda6d2..9f73c80 100644 (file)
@@ -266,6 +266,7 @@ $wgIgnoredMessages = array(
        'createacct-benefit-icon3',
        'today-at',
        'redirect-text',
+       'helppage',
        'edithelppage',
        'helplogin-url',
        'autocomment-prefix',
index ad1090a..7c2860e 100644 (file)
@@ -383,9 +383,10 @@ class CologneBlueTemplate extends BaseTemplate {
                                Title::newFromText( wfMessage( 'aboutpage' )->inContentLanguage()->text() ),
                                wfMessage( 'about' )->text()
                        ),
-                       Linker::linkKnown(
-                               Title::newFromText( wfMessage( 'helppage' )->inContentLanguage()->text() ),
-                               wfMessage( 'help' )->text()
+                       Linker::makeExternalLink(
+                               Skin::makeInternalOrExternalUrl( wfMessage( 'helppage' )->inContentLanguage()->text() ),
+                               wfMessage( 'help' )->text(),
+                               false
                        ),
                        Linker::linkKnown(
                                Title::newFromText( wfMessage( 'faqpage' )->inContentLanguage()->text() ),
index 534d333..f3e4100 100644 (file)
@@ -36,6 +36,16 @@ div#footer {
        border-right: 1px solid #fabd23;
 }
 
+/* float/negative margin brokenness */
+* html div#footer {
+       margin-top: 0;
+}
+
+* html div#column-content {
+       display: inline;
+       margin-bottom: 0;
+}
+
 /* the tabs */
 
 #p-cactions {
index 6d37657..4326496 100644 (file)
@@ -660,59 +660,17 @@ td.htmlform-tip {
        font-weight: bold;
 }
 
-/*
-** IE/Mac fixes, hope to find a validating way to move this
-** to a separate stylesheet. This would work but doesn't validate:
-** @import("IEMacFixes.css");
-*/
-/* tabs: border on the a, not the div */
-* > html #p-cactions li {
-       border: none;
-}
-* > html #p-cactions li a {
-       border: 1px solid #aaa;
-       border-bottom: none;
-}
-* > html #p-cactions li.selected a {
-       border-color: #fabd23;
-}
-/* footer icons need a fixed width */
-* > html #f-poweredbyico,
-* > html #f-copyrightico {
-       width: 88px;
-}
-* > html #bodyContent,
-* > html #bodyContent pre {
-       overflow-x: auto;
-       width: 100%;
-       padding-bottom: 25px;
-}
-
-/* more IE fixes */
-/* float/negative margin brokenness */
-* html div#footer {
-       margin-top: 0;
-}
-* html div#column-content {
-       display: inline;
-       margin-bottom: 0;
-}
+/**
+ * This was originally added by Gabriel Wicke in r3681 (committed on 25 May 2004)
+ * with the commit message "tweaks to page history".
+ * Unlike the other IE/Mac fixes that used to be present here, this seems to get
+ * applied on more modern browsers, so let's keep it here until someone has the
+ * time to properly test it out.
+ */
 #pagehistory li.selected {
        position: relative;
 }
 
-/* Mac IE 5.0 fix; floated content turns invisible */
-* > html div#column-content {
-       float: none;
-}
-* > html div#column-one {
-       position: absolute;
-       left: 0;
-       top: 0;
-}
-* > html div#footer {
-       margin-left: 13.2em;
-}
 .redirectText {
        font-size: 150%;
        margin: 5px;
index 7d33a59..3fb487c 100644 (file)
@@ -15,7 +15,8 @@ class SideBarTest extends MediaWikiLangTestCase {
 
        /** Build $this->messages array */
        private function initMessagesHref() {
-               # List of default messages for the sidebar:
+               # List of default messages for the sidebar. The sidebar doesn't care at
+               # all whether they are full URLs, interwiki links or local titles.
                $URL_messages = array(
                        'mainpage',
                        'portal-url',
@@ -25,10 +26,16 @@ class SideBarTest extends MediaWikiLangTestCase {
                        'helppage',
                );
 
+               # We're assuming that isValidURI works as advertised: it's also
+               # tested separately, in tests/phpunit/includes/HttpTest.php.
                foreach ( $URL_messages as $m ) {
                        $titleName = MessageCache::singleton()->get( $m );
-                       $title = Title::newFromText( $titleName );
-                       $this->messages[$m]['href'] = $title->getLocalURL();
+                       if ( Http::isValidURI( $titleName ) ) {
+                               $this->messages[$m]['href'] = $titleName;
+                       } else {
+                               $title = Title::newFromText( $titleName );
+                               $this->messages[$m]['href'] = $title->getLocalURL();
+                       }
                }
        }
 
index 292c576..24a7cc9 100644 (file)
        } );
 
        QUnit.test( 'Int', 4, function ( assert ) {
-               var newarticletextSource = 'You have followed a link to a page that does not exist yet. To create the page, start typing in the box below (see the [[{{Int:Helppage}}|help page]] for more info). If you are here by mistake, click your browser\'s back button.',
+               var newarticletextSource = 'You have followed a link to a page that does not exist yet. To create the page, start typing in the box below (see the [[{{Int:Foobar}}|foobar]] for more info). If you are here by mistake, click your browser\'s back button.',
                        expectedNewarticletext,
-                       helpPageTitle = 'Help:Contents';
+                       helpPageTitle = 'Help:Foobar';
 
-               mw.messages.set( 'helppage', helpPageTitle );
+               mw.messages.set( 'foobar', helpPageTitle );
 
                expectedNewarticletext = 'You have followed a link to a page that does not exist yet. To create the page, start typing in the box below (see the ' +
-                       '<a title="Help:Contents" href="/wiki/Help:Contents">help page</a> for more info). If you are here by mistake, click your browser\'s back button.';
+                       '<a title="Help:Foobar" href="/wiki/Help:Foobar">foobar</a> for more info). If you are here by mistake, click your browser\'s back button.';
 
                mw.messages.set( 'newarticletext', newarticletextSource );