Merge "SpecialUnusedimages: Change message when CountCategorizedImagesAsUsed"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 8 Dec 2018 21:32:17 +0000 (21:32 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 8 Dec 2018 21:32:17 +0000 (21:32 +0000)
includes/parser/BlockLevelPass.php
includes/parser/Parser.php
includes/parser/ParserOptions.php
includes/skins/Skin.php
includes/specials/pagers/ContribsPager.php

index 0553db9..bb448b2 100644 (file)
@@ -53,7 +53,8 @@ class BlockLevelPass {
        }
 
        /**
-        * Private constructor
+        * @param string $text
+        * @param bool $lineStart
         */
        private function __construct( $text, $lineStart ) {
                $this->text = $text;
index 81e23ad..d78ccff 100644 (file)
@@ -5470,6 +5470,7 @@ class Parser {
         * Adds an entry to appropriate link tables.
         *
         * @since 1.32
+        * @param string $value
         * @return array of `[ type, target ]`, where:
         *   - `type` is one of:
         *     - `null`: Given value is not a valid link target, use default
index 032d481..8407992 100644 (file)
@@ -650,8 +650,10 @@ class ParserOptions {
 
        /**
         * Lazy initializer for dateFormat
+        * @param ParserOptions $popt
+        * @return string
         */
-       private static function initDateFormat( $popt ) {
+       private static function initDateFormat( ParserOptions $popt ) {
                return $popt->mUser->getDatePreference();
        }
 
index 1e0051d..809d411 100644 (file)
@@ -196,7 +196,6 @@ abstract class Skin extends ContextSource {
                        'core' => [
                                'site',
                                'mediawiki.page.startup',
-                               'mediawiki.user',
                        ],
                        // modules that enhance the content in some way
                        'content' => [
index 5cfc437..510bf92 100644 (file)
@@ -415,9 +415,10 @@ class ContribsPager extends RangeChronologicalPager {
         * id then null is returned.
         *
         * @param object $row
+        * @param Title|null $title
         * @return Revision|null
         */
-       public function tryToCreateValidRevision( $row ) {
+       public function tryToCreateValidRevision( $row, $title = null ) {
                /*
                 * There may be more than just revision rows. To make sure that we'll only be processing
                 * revisions here, let's _try_ to build a revision out of our row (without displaying
@@ -427,7 +428,7 @@ class ContribsPager extends RangeChronologicalPager {
                 */
                Wikimedia\suppressWarnings();
                try {
-                       $rev = new Revision( $row );
+                       $rev = new Revision( $row, 0, $title );
                        $validRevision = (bool)$rev->getId();
                } catch ( Exception $e ) {
                        $validRevision = false;
@@ -455,11 +456,16 @@ class ContribsPager extends RangeChronologicalPager {
 
                $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
 
-               $rev = $this->tryToCreateValidRevision( $row );
+               $page = null;
+               // Create a title for the revision if possible
+               // Rows from the hook may not include title information
+               if ( isset( $row->page_namespace ) && isset( $row->page_title ) ) {
+                       $page = Title::newFromRow( $row );
+               }
+               $rev = $this->tryToCreateValidRevision( $row, $page );
                if ( $rev ) {
                        $attribs['data-mw-revid'] = $rev->getId();
 
-                       $page = Title::newFromRow( $row );
                        $link = $linkRenderer->makeLink(
                                $page,
                                $page->getPrefixedText(),