Merge "Special:Preferences: Split up "Advanced options" on watchlist and RC tabs"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 14 Nov 2018 20:52:39 +0000 (20:52 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 14 Nov 2018 20:52:39 +0000 (20:52 +0000)
RELEASE-NOTES-1.33
includes/DefaultSettings.php
includes/changetags/ChangeTags.php
includes/htmlform/fields/HTMLTitlesMultiselectField.php
includes/jobqueue/JobQueue.php
includes/logging/LogEventsList.php
includes/specials/SpecialBlock.php
includes/widget/TitlesMultiselectWidget.php
resources/src/mediawiki.legacy/oldshared.css
tests/phpunit/includes/changetags/ChangeTagsTest.php

index 640bb1d..7bbb165 100644 (file)
@@ -18,9 +18,14 @@ production.
 * Some external link searches will not work correctly until update.php (or
   refreshExternallinksIndex.php) is run. These include searches for links using
   IP addresses, internationalized domain names, and possibly mailto links.
+* (T193868) $wgChangeTagsSchemaMigrationStage — This temporary setting, added in
+  MediaWiki 1.32, now defaults to MIGRATION_NEW instead of MIGRATION_WRITE_BOTH.
 * …
 
 ==== Removed configuration ====
+* (T199334) $wgTagStatisticsNewTable — This temporary setting, added in
+  MediaWiki 1.32, has now been removed. When loading Special:Tags, MediaWiki
+  will now always use the `change_tag_def` instead of the `change_tag` table.
 * …
 
 === New features in 1.33 ===
index 2d1681c..15cb5bf 100644 (file)
@@ -9031,19 +9031,7 @@ $wgActorTableSchemaMigrationStage = SCHEMA_COMPAT_OLD;
  * @since 1.32
  * @var int One of the MIGRATION_* constants
  */
-$wgChangeTagsSchemaMigrationStage = MIGRATION_WRITE_BOTH;
-
-/**
- * Temporarily flag to use change_tag_def table as backend of change tag statistics.
- * For example in case of Special:Tags. If set to false, it will use change_tag table.
- * Before setting it to true set $wgChangeTagsSchemaMigrationStage to MIGRATION_WRITE_BOTH and run
- * PopulateChangeTagDef maintaince script.
- * It's redundant when $wgChangeTagsSchemaMigrationStage is set to MIGRATION_NEW
- *
- * @since 1.32
- * @var bool
- */
-$wgTagStatisticsNewTable = false;
+$wgChangeTagsSchemaMigrationStage = MIGRATION_NEW;
 
 /**
  * Flag to enable Partial Blocks. This allows an admin to prevent a user from editing specific pages
index b28983f..0e36009 100644 (file)
@@ -1590,10 +1590,8 @@ class ChangeTags {
         * @return array Array of string => int
         */
        public static function tagUsageStatistics() {
-               global $wgChangeTagsSchemaMigrationStage, $wgTagStatisticsNewTable;
-               if ( $wgChangeTagsSchemaMigrationStage > MIGRATION_WRITE_BOTH ||
-                       ( $wgTagStatisticsNewTable && $wgChangeTagsSchemaMigrationStage > MIGRATION_OLD )
-               ) {
+               global $wgChangeTagsSchemaMigrationStage;
+               if ( $wgChangeTagsSchemaMigrationStage > MIGRATION_WRITE_BOTH ) {
                        return self::newTagUsageStatistics();
                }
 
index e2399b9..6fef23b 100644 (file)
@@ -103,6 +103,10 @@ class HTMLTitlesMultiselectField extends HTMLTitleTextField {
                        $params['showMissing'] = $this->mParams['showMissing'];
                }
 
+               if ( isset( $this->mParams['input'] ) ) {
+                       $params['input'] = $this->mParams['input'];
+               }
+
                if ( !is_null( $value ) ) {
                        // $value is a string, but the widget expects an array
                        $params['default'] = $value === '' ? [] : explode( "\n", $value );
index 7d34f32..3689ba4 100644 (file)
@@ -531,7 +531,7 @@ abstract class JobQueue {
         * @return string
         */
        protected function getRootJobCacheKey( $signature ) {
-               $this->dupCache->makeGlobalKey(
+               return $this->dupCache->makeGlobalKey(
                        'jobqueue',
                        $this->domain,
                        $this->type,
index a5aa687..c66aa59 100644 (file)
@@ -148,7 +148,7 @@ class LogEventsList extends ContextSource {
                $formDescriptor['date'] = [
                        'type' => 'date',
                        'label-message' => 'date',
-                       'default' => sprintf( "%04d-%02d-%02d", $year, $month, $day ),
+                       'default' => $year && $month && $day ? sprintf( "%04d-%02d-%02d", $year, $month, $day ) : '',
                ];
 
                // Tag filter
@@ -174,7 +174,7 @@ class LogEventsList extends ContextSource {
 
                $context = new DerivativeContext( $this->getContext() );
                $context->setTitle( SpecialPage::getTitleFor( 'Log' ) ); // Remove subpage
-               $htmlForm = new HTMLForm( $formDescriptor, $context );
+               $htmlForm = HTMLForm::factory( 'ooui', $formDescriptor, $context );
                $htmlForm
                        ->setSubmitText( $this->msg( 'logeventslist-submit' )->text() )
                        ->setMethod( 'get' )
index 918ce4a..ea4cd22 100644 (file)
@@ -172,6 +172,9 @@ class SpecialBlock extends FormSpecialPage {
                                'max' => 10,
                                'cssclass' => 'mw-block-page-restrictions',
                                'showMissing' => false,
+                               'input' => [
+                                       'autocomplete' => false
+                               ],
                        ];
                }
 
index 316748d..0f5710f 100644 (file)
@@ -25,6 +25,7 @@ class TitlesMultiselectWidget extends \OOUI\Widget {
         *   - array $config['name'] Name attribute (used in forms)
         *   - number $config['tagLimit'] Maximum number of selected titles
         *   - bool $config['showMissing'] Show missing pages
+        *   - array $config['input'] Config options for the input widget
         */
        public function __construct( array $config = [] ) {
                parent::__construct( $config );
@@ -45,12 +46,16 @@ class TitlesMultiselectWidget extends \OOUI\Widget {
                if ( isset( $config['showMissing'] ) ) {
                        $this->showMissing = $config['showMissing'];
                }
+               if ( isset( $config['input'] ) ) {
+                       $this->input = $config['input'];
+               }
 
-               $textarea = new MultilineTextInputWidget( [
+               $textarea = new MultilineTextInputWidget( array_merge( [
                        'name' => $this->inputName,
                        'value' => implode( "\n", $this->titlesArray ),
                        'rows' => 10,
-               ] );
+               ], $this->input ) );
+
                $this->appendContent( $textarea );
                $this->addClasses( [ 'mw-widgets-titlesMultiselectWidget' ] );
        }
@@ -75,6 +80,9 @@ class TitlesMultiselectWidget extends \OOUI\Widget {
                if ( $this->showMissing !== null ) {
                        $config['showMissing'] = $this->showMissing;
                }
+               if ( $this->input !== null ) {
+                       $config['input'] = $this->input;
+               }
 
                $config['$overlay'] = true;
                return parent::getConfig( $config );
index b449ef6..f5a8272 100644 (file)
@@ -337,23 +337,6 @@ table.mw_metadata td.spacer {
        clear: both;
 }
 
-/* Allmessages table */
-#allmessagestable th {
-       background-color: #b2b2ff;
-}
-
-#allmessagestable tr.orig {
-       background-color: #ffe2e2;
-}
-
-#allmessagestable tr.new {
-       background-color: #e2ffe2;
-}
-
-#allmessagestable tr.def {
-       background-color: #f0f0ff;
-}
-
 #jump-to-nav {
        display: none;
 }
index f207564..cb9dd41 100644 (file)
@@ -30,6 +30,8 @@ class ChangeTagsTest extends MediaWikiTestCase {
        /** @dataProvider provideModifyDisplayQuery */
        public function testModifyDisplayQuery( $origQuery, $filter_tag, $useTags, $modifiedQuery ) {
                $this->setMwGlobals( 'wgUseTagFilter', $useTags );
+               $rcId = 123;
+               ChangeTags::updateTags( [ 'foo', 'bar' ], [], $rcId );
                // HACK resolve deferred group concats (see comment in provideModifyDisplayQuery)
                if ( isset( $modifiedQuery['fields']['ts_tags'] ) ) {
                        $modifiedQuery['fields']['ts_tags'] = call_user_func_array(
@@ -61,11 +63,13 @@ class ChangeTagsTest extends MediaWikiTestCase {
        public function provideModifyDisplayQuery() {
                // HACK if we call $dbr->buildGroupConcatField() now, it will return the wrong table names
                // We have to have the test runner call it instead
+               $baseConcats = [ ',', [ 'change_tag', 'change_tag_def' ], 'ctd_name' ];
+               $joinConds = [ 'change_tag_def' => [ 'INNER JOIN', 'ct_tag_id=ctd_id' ] ];
                $groupConcats = [
-                       'recentchanges' => [ ',', 'change_tag', 'ct_tag', 'ct_rc_id=rc_id' ],
-                       'logging' => [ ',', 'change_tag', 'ct_tag', 'ct_log_id=log_id' ],
-                       'revision' => [ ',', 'change_tag', 'ct_tag', 'ct_rev_id=rev_id' ],
-                       'archive' => [ ',', 'change_tag', 'ct_tag', 'ct_rev_id=ar_rev_id' ],
+                       'recentchanges' => array_merge( $baseConcats, [ 'ct_rc_id=rc_id', $joinConds ] ),
+                       'logging' => array_merge( $baseConcats, [ 'ct_log_id=log_id', $joinConds ] ),
+                       'revision' => array_merge( $baseConcats, [ 'ct_rev_id=rev_id', $joinConds ] ),
+                       'archive' => array_merge( $baseConcats, [ 'ct_rev_id=ar_rev_id', $joinConds ] ),
                ];
 
                return [
@@ -118,7 +122,7 @@ class ChangeTagsTest extends MediaWikiTestCase {
                                [
                                        'tables' => [ 'recentchanges', 'change_tag' ],
                                        'fields' => [ 'rc_id', 'rc_timestamp', 'ts_tags' => $groupConcats['recentchanges'] ],
-                                       'conds' => [ "rc_timestamp > '20170714183203'", 'ct_tag' => 'foo' ],
+                                       'conds' => [ "rc_timestamp > '20170714183203'", 'ct_tag_id' => [ 1 ] ],
                                        'join_conds' => [ 'change_tag' => [ 'INNER JOIN', 'ct_rc_id=rc_id' ] ],
                                        'options' => [ 'ORDER BY' => 'rc_timestamp DESC' ],
                                ]
@@ -136,7 +140,7 @@ class ChangeTagsTest extends MediaWikiTestCase {
                                [
                                        'tables' => [ 'logging', 'change_tag' ],
                                        'fields' => [ 'log_id', 'ts_tags' => $groupConcats['logging'] ],
-                                       'conds' => [ "log_timestamp > '20170714183203'", 'ct_tag' => 'foo' ],
+                                       'conds' => [ "log_timestamp > '20170714183203'", 'ct_tag_id' => [ 1 ] ],
                                        'join_conds' => [ 'change_tag' => [ 'INNER JOIN', 'ct_log_id=log_id' ] ],
                                        'options' => [ 'ORDER BY log_timestamp DESC' ],
                                ]
@@ -154,7 +158,7 @@ class ChangeTagsTest extends MediaWikiTestCase {
                                [
                                        'tables' => [ 'revision', 'change_tag' ],
                                        'fields' => [ 'rev_id', 'rev_timestamp', 'ts_tags' => $groupConcats['revision'] ],
-                                       'conds' => [ "rev_timestamp > '20170714183203'", 'ct_tag' => 'foo' ],
+                                       'conds' => [ "rev_timestamp > '20170714183203'", 'ct_tag_id' => [ 1 ] ],
                                        'join_conds' => [ 'change_tag' => [ 'INNER JOIN', 'ct_rev_id=rev_id' ] ],
                                        'options' => [ 'ORDER BY' => 'rev_timestamp DESC' ],
                                ]
@@ -172,7 +176,7 @@ class ChangeTagsTest extends MediaWikiTestCase {
                                [
                                        'tables' => [ 'archive', 'change_tag' ],
                                        'fields' => [ 'ar_id', 'ar_timestamp', 'ts_tags' => $groupConcats['archive'] ],
-                                       'conds' => [ "ar_timestamp > '20170714183203'", 'ct_tag' => 'foo' ],
+                                       'conds' => [ "ar_timestamp > '20170714183203'", 'ct_tag_id' => [ 1 ] ],
                                        'join_conds' => [ 'change_tag' => [ 'INNER JOIN', 'ct_rev_id=ar_rev_id' ] ],
                                        'options' => [ 'ORDER BY' => 'ar_timestamp DESC' ],
                                ]
@@ -220,7 +224,7 @@ class ChangeTagsTest extends MediaWikiTestCase {
                                [
                                        'tables' => [ 'recentchanges', 'change_tag' ],
                                        'fields' => [ 'rc_id', 'rc_timestamp', 'ts_tags' => $groupConcats['recentchanges'] ],
-                                       'conds' => [ "rc_timestamp > '20170714183203'", 'ct_tag' => [ 'foo', 'bar' ] ],
+                                       'conds' => [ "rc_timestamp > '20170714183203'", 'ct_tag_id' => [ 1, 2 ] ],
                                        'join_conds' => [ 'change_tag' => [ 'INNER JOIN', 'ct_rc_id=rc_id' ] ],
                                        'options' => [ 'ORDER BY' => 'rc_timestamp DESC', 'DISTINCT' ],
                                ]
@@ -238,7 +242,7 @@ class ChangeTagsTest extends MediaWikiTestCase {
                                [
                                        'tables' => [ 'recentchanges', 'change_tag' ],
                                        'fields' => [ 'rc_id', 'rc_timestamp', 'ts_tags' => $groupConcats['recentchanges'] ],
-                                       'conds' => [ "rc_timestamp > '20170714183203'", 'ct_tag' => [ 'foo', 'bar' ] ],
+                                       'conds' => [ "rc_timestamp > '20170714183203'", 'ct_tag_id' => [ 1, 2 ] ],
                                        'join_conds' => [ 'change_tag' => [ 'INNER JOIN', 'ct_rc_id=rc_id' ] ],
                                        'options' => [ 'DISTINCT', 'ORDER BY' => 'rc_timestamp DESC' ],
                                ]
@@ -256,7 +260,7 @@ class ChangeTagsTest extends MediaWikiTestCase {
                                [
                                        'tables' => [ 'recentchanges', 'change_tag' ],
                                        'fields' => [ 'rc_id', 'ts_tags' => $groupConcats['recentchanges'] ],
-                                       'conds' => [ "rc_timestamp > '20170714183203'", 'ct_tag' => [ 'foo', 'bar' ] ],
+                                       'conds' => [ "rc_timestamp > '20170714183203'", 'ct_tag_id' => [ 1, 2 ] ],
                                        'join_conds' => [ 'change_tag' => [ 'INNER JOIN', 'ct_rc_id=rc_id' ] ],
                                        'options' => [ 'ORDER BY rc_timestamp DESC', 'DISTINCT' ],
                                ]