Merge "mw.Title.newFromUserInput: Rename vars, improve docs for double signature"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 12 Dec 2018 17:55:34 +0000 (17:55 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 12 Dec 2018 17:55:34 +0000 (17:55 +0000)
includes/api/ApiBase.php
includes/api/ApiFeedWatchlist.php
includes/specials/pagers/ImageListPager.php
resources/src/startup/mediawiki.log.js

index 9ea8c6d..d29131b 100644 (file)
@@ -1856,7 +1856,7 @@ abstract class ApiBase extends ContextSource {
                                                'min_id' => "MIN($field)",
                                                'max_id' => "MAX($field)",
                                        ],
-                                       null,
+                                       '',
                                        __METHOD__
                                );
                                self::$filterIDsCache[$table][$field] = $row;
index 37ec3cf..8c0b42d 100644 (file)
@@ -69,7 +69,7 @@ class ApiFeedWatchlist extends ApiBase {
                                'meta' => 'siteinfo',
                                'siprop' => 'general',
                                'list' => 'watchlist',
-                               'wlprop' => 'title|user|comment|timestamp|ids',
+                               'wlprop' => 'title|user|comment|timestamp|ids|loginfo',
                                'wldir' => 'older', // reverse order - from newest to oldest
                                'wlend' => $endTime, // stop at this time
                                'wllimit' => min( 50, $this->getConfig()->get( 'FeedLimit' ) )
@@ -193,7 +193,12 @@ class ApiFeedWatchlist extends ApiBase {
                        }
                }
                if ( isset( $info['revid'] ) ) {
-                       $titleUrl = $title->getFullURL( [ 'diff' => $info['revid'] ] );
+                       if ( $info['revid'] === 0 && isset( $info['logid'] ) ) {
+                               $logTitle = Title::makeTitle( NS_SPECIAL, 'Log' );
+                               $titleUrl = $logTitle->getFullURL( [ 'logid' => $info['logid'] ] );
+                       } else {
+                               $titleUrl = $title->getFullURL( [ 'diff' => $info['revid'] ] );
+                       }
                } else {
                        $titleUrl = $title->getFullURL( $curidParam );
                }
index ab3237a..ab38e1a 100644 (file)
@@ -139,7 +139,9 @@ class ImageListPager extends TablePager {
                        $actorWhere = ActorMigration::newMigration()->getWhere(
                                $dbr,
                                $prefix . '_user',
-                               User::newFromName( $this->mUserName, false )
+                               User::newFromName( $this->mUserName, false ),
+                               // oldimage doesn't have an index on oi_user, while image does. Set $useId accordingly.
+                               $prefix === 'img'
                        );
                        $conds[] = $actorWhere['conds'];
                }
index 9283b16..e8eb0ae 100644 (file)
@@ -7,7 +7,7 @@
  * @author Trevor Parscal <tparscal@wikimedia.org>
  */
 ( function () {
-       /* global console, mw */
+       /* global mw */
        /* eslint-disable no-console */
        var original = mw.log;