Merge "Enable preservation of grapheme clusters in highlightQuery"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 24 Sep 2019 21:51:19 +0000 (21:51 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 24 Sep 2019 21:51:19 +0000 (21:51 +0000)
includes/DefaultSettings.php
includes/Revision/RevisionStore.php
includes/http/HttpRequestFactory.php
includes/logging/LogPager.php
includes/specials/pagers/NewFilesPager.php
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.WatchlistTopSectionWidget.less
tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js

index 1068700..29b628c 100644 (file)
@@ -9096,6 +9096,9 @@ $wgNativeImageLazyLoading = false;
 
 /**
  * Option to whether serve the main page as the domain root
+ *
+ * @warning EXPERIMENTAL!
+ *
  * @since 1.34
  * @var bool
  */
index 3ecef76..a5cf840 100644 (file)
@@ -1907,7 +1907,11 @@ class RevisionStore
         *               'content'- whether the actual content of the slots should be
         *               preloaded.
         * @param int $queryFlags
-        * @param Title|null $title
+        * @param Title|null $title The title to which all the revision rows belong, if there
+        *        is such a title and the caller has it handy, so we don't have to look it up again.
+        *        If this parameter is given and any of the rows has a rev_page_id that is different
+        *        from $title->getArticleID(), an InvalidArgumentException is thrown.
+        *
         * @return StatusValue a status with a RevisionRecord[] of successfully fetched revisions
         *                                         and an array of errors for the revisions failed to fetch.
         */
index 5315ced..84e7b73 100644 (file)
@@ -59,13 +59,12 @@ class HttpRequestFactory {
         *    - originalRequest     Information about the original request (as a WebRequest object or
         *                          an associative array with 'ip' and 'userAgent').
         * @codingStandardsIgnoreStart
-        * @phan-param array{timeout?:int|string,connectTimeout?:int|string,postData?:array,proxy?:string,noProxy?:bool,sslVerifyHost?:bool,sslVerifyCert?:bool,caInfo?:string,maxRedirects?:int,followRedirects?:bool,userAgent?:string,method?:string,logger?:\Psr\Log\LoggerInterface,username?:string,password?:string,originalRequest?:WebRequest|array{ip:string,userAgent:string}} $options
+        * @phan-param array{timeout?:int|string,connectTimeout?:int|string,postData?:array,proxy?:string,noProxy?:bool,sslVerifyHost?:bool,sslVerifyCert?:bool,caInfo?:string,maxRedirects?:int,followRedirects?:bool,userAgent?:string,method?:string,logger?:\Psr\Log\LoggerInterface,username?:string,password?:string,originalRequest?:\WebRequest|array{ip:string,userAgent:string}} $options
         * @codingStandardsIgnoreEnd
         * @param string $caller The method making this request, for profiling
         * @throws RuntimeException
         * @return MWHttpRequest
         * @see MWHttpRequest::__construct
-        * @suppress PhanUndeclaredTypeParameter
         */
        public function create( $url, array $options = [], $caller = __METHOD__ ) {
                if ( !Http::$httpEngine ) {
index 781df06..0b78a36 100644 (file)
@@ -361,6 +361,11 @@ class LogPager extends ReverseChronologicalPager {
                if ( !$this->mTagFilter && !array_key_exists( 'ls_field', $this->mConds ) ) {
                        $options[] = 'STRAIGHT_JOIN';
                }
+               if ( $this->performer !== '' ) {
+                       // T223151: MariaDB's optimizer, at least 10.1, likes to choose a wildly bad plan for
+                       // some reason for this code path. Tell it not to use the wrong index it wants to pick.
+                       $options['IGNORE INDEX'] = [ 'logging' => [ 'times' ] ];
+               }
 
                $info = [
                        'tables' => $tables,
index be4a1bd..9a78c5d 100644 (file)
@@ -64,11 +64,11 @@ class NewFilesPager extends RangeChronologicalPager {
        function getQueryInfo() {
                $opts = $this->opts;
                $conds = [];
-               $imgQuery = LocalFile::getQueryInfo();
-               $tables = $imgQuery['tables'];
-               $fields = [ 'img_name', 'img_timestamp' ] + $imgQuery['fields'];
+               $actorQuery = ActorMigration::newMigration()->getJoin( 'img_user' );
+               $tables = [ 'image' ] + $actorQuery['tables'];
+               $fields = [ 'img_name', 'img_timestamp' ] + $actorQuery['fields'];
                $options = [];
-               $jconds = $imgQuery['joins'];
+               $jconds = $actorQuery['joins'];
 
                $user = $opts->getValue( 'user' );
                if ( $user !== '' ) {
@@ -89,7 +89,7 @@ class NewFilesPager extends RangeChronologicalPager {
                                        'LEFT JOIN',
                                        [
                                                'ug_group' => $groupsWithBotPermission,
-                                               'ug_user = ' . $imgQuery['fields']['img_user'],
+                                               'ug_user = ' . $actorQuery['fields']['img_user'],
                                                'ug_expiry IS NULL OR ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() )
                                        ]
                                ];
@@ -107,7 +107,7 @@ class NewFilesPager extends RangeChronologicalPager {
                                'JOIN',
                                [
                                        'rc_title = img_name',
-                                       'rc_actor = ' . $imgQuery['fields']['img_actor'],
+                                       'rc_actor = ' . $actorQuery['fields']['img_actor'],
                                        'rc_timestamp = img_timestamp'
                                ]
                        ];
index dff7881..9559d3a 100644 (file)
        font-weight: bold;
 }
 
+// on smaller screen, set .watchlistDetail to full width
+// so that the spinner doesn't appear beside it. T225127#5518870
+@media screen and ( max-width: @width-breakpoint-tablet ) {
+       .client-js {
+               /* stylelint-disable-next-line selector-class-pattern */
+               .watchlistDetails {
+                       float: none;
+                       width: auto;
+               }
+       }
+}
+
 @-webkit-keyframes rcfiltersBouncedelay {
        // 50% equals 800ms
        0%,
index 52f7ff2..75da5dd 100644 (file)
                border-top: 2px solid @colorGray14;
        }
 }
+
+// On small screens, remove the table properties from the
+// top section. T225127#5518870
+@media screen and ( max-width: @width-breakpoint-tablet ) {
+       .mw-rcfilters-ui-watchlistTopSectionWidget {
+               .mw-rcfilters-ui-table,
+               .mw-rcfilters-ui-row,
+               .mw-rcfilters-ui-cell {
+                       display: block;
+               }
+
+               &-editWatchlistButton {
+                       margin-top: 1em;
+               }
+       }
+}
index 59672f4..16c3183 100644 (file)
                        [ 'test.load.circleB', '0', [ 'test.load.circleC' ] ],
                        [ 'test.load.circleC', '0', [ 'test.load.circleA' ] ]
                ] );
-               this.sandbox.stub( mw, 'track', function ( topic, data ) {
+               this.sandbox.stub( mw, 'trackError', function ( topic, data ) {
                        capture.push( {
                                topic: topic,
                                error: data.exception && data.exception.message,
                mw.loader.register( [
                        [ 'test.load.circleDirect', '0', [ 'test.load.circleDirect' ] ]
                ] );
-               this.sandbox.stub( mw, 'track', function ( topic, data ) {
+               this.sandbox.stub( mw, 'trackError', function ( topic, data ) {
                        capture.push( {
                                topic: topic,
                                error: data.exception && data.exception.message,
        // Regression test for T36853
        QUnit.test( '.load() - Error: Missing dependency', function ( assert ) {
                var capture = [];
-               this.sandbox.stub( mw, 'track', function ( topic, data ) {
+               this.sandbox.stub( mw, 'trackError', function ( topic, data ) {
                        capture.push( {
                                topic: topic,
                                error: data.exception && data.exception.message,
                this.useStubClock();
 
                // Don't actually emit an error event
-               this.sandbox.stub( mw, 'track' );
+               this.sandbox.stub( mw, 'trackError' );
 
                mw.loader.register( [
                        [ 'test.module1', '0' ],
                }, {}, {} );
                this.tick();
 
-               assert.strictEqual( mw.loader.getState( 'test.module1' ), 'error', 'Expected "error" state for test.module1' );
-               assert.strictEqual( mw.loader.getState( 'test.module2' ), 'error', 'Expected "error" state for test.module2' );
-               assert.strictEqual( mw.loader.getState( 'test.module3' ), 'error', 'Expected "error" state for test.module3' );
+               assert.strictEqual( mw.loader.getState( 'test.module1' ), 'error', 'State of test.module1' );
+               assert.strictEqual( mw.loader.getState( 'test.module2' ), 'error', 'State of test.module2' );
+               assert.strictEqual( mw.loader.getState( 'test.module3' ), 'error', 'State of test.module3' );
 
-               assert.strictEqual( mw.track.callCount, 1 );
+               assert.strictEqual( mw.trackError.callCount, 1 );
        } );
 
        QUnit.test( 'Out-of-order implementation', function ( assert ) {
 
                mw.loader.implement( 'test.module4', function () {} );
                this.tick();
-               assert.strictEqual( mw.loader.getState( 'test.module4' ), 'ready', 'Expected "ready" state for test.module4' );
-               assert.strictEqual( mw.loader.getState( 'test.module5' ), 'registered', 'Expected "registered" state for test.module5' );
-               assert.strictEqual( mw.loader.getState( 'test.module6' ), 'registered', 'Expected "registered" state for test.module6' );
+               assert.strictEqual( mw.loader.getState( 'test.module4' ), 'ready', 'State of test.module4' );
+               assert.strictEqual( mw.loader.getState( 'test.module5' ), 'registered', 'State of test.module5' );
+               assert.strictEqual( mw.loader.getState( 'test.module6' ), 'registered', 'State of test.module6' );
 
                mw.loader.implement( 'test.module6', function () {} );
                this.tick();
-               assert.strictEqual( mw.loader.getState( 'test.module4' ), 'ready', 'Expected "ready" state for test.module4' );
-               assert.strictEqual( mw.loader.getState( 'test.module5' ), 'registered', 'Expected "registered" state for test.module5' );
-               assert.strictEqual( mw.loader.getState( 'test.module6' ), 'loaded', 'Expected "loaded" state for test.module6' );
+               assert.strictEqual( mw.loader.getState( 'test.module4' ), 'ready', 'State of test.module4' );
+               assert.strictEqual( mw.loader.getState( 'test.module5' ), 'registered', 'State of test.module5' );
+               assert.strictEqual( mw.loader.getState( 'test.module6' ), 'loaded', 'State of test.module6' );
 
                mw.loader.implement( 'test.module5', function () {} );
                this.tick();
-               assert.strictEqual( mw.loader.getState( 'test.module4' ), 'ready', 'Expected "ready" state for test.module4' );
-               assert.strictEqual( mw.loader.getState( 'test.module5' ), 'ready', 'Expected "ready" state for test.module5' );
-               assert.strictEqual( mw.loader.getState( 'test.module6' ), 'ready', 'Expected "ready" state for test.module6' );
+               assert.strictEqual( mw.loader.getState( 'test.module4' ), 'ready', 'State of test.module4' );
+               assert.strictEqual( mw.loader.getState( 'test.module5' ), 'ready', 'State of test.module5' );
+               assert.strictEqual( mw.loader.getState( 'test.module6' ), 'ready', 'State of test.module6' );
        } );
 
        QUnit.test( 'Missing dependency', function ( assert ) {