Merge "Set migration stage for change tag to read new"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 14 Nov 2018 16:28:34 +0000 (16:28 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 14 Nov 2018 16:28:34 +0000 (16:28 +0000)
1  2 
includes/DefaultSettings.php
includes/changetags/ChangeTags.php

@@@ -1225,16 -1225,6 +1225,16 @@@ $wgSVGMetadataCutoff = 262144
   */
  $wgAllowTitlesInSVG = false;
  
 +/**
 + * Whether thumbnails should be generated in target language (usually, same as
 + * page language), if available.
 + * Currently, applies only to SVG images that use the systemLanguage attribute
 + * to specify text language.
 + *
 + * @since 1.33
 + */
 +$wgMediaInTargetLanguage = false;
 +
  /**
   * The maximum number of pixels a source image can have if it is to be scaled
   * down by a scaler that requires the full source image to be decompressed
@@@ -1867,7 -1857,7 +1867,7 @@@ $wgDBserver = 'localhost'
  $wgDBport = 5432;
  
  /**
 - * Name of the database
 + * Name of the database; this should be alphanumeric and not contain spaces nor hyphens
   */
  $wgDBname = 'my_wiki';
  
@@@ -1934,7 -1924,7 +1934,7 @@@ $wgSearchType = null
  $wgSearchTypeAlternatives = null;
  
  /**
 - * Table name prefix
 + * Table name prefix; this should be alphanumeric and not contain spaces nor hyphens
   */
  $wgDBprefix = '';
  
@@@ -1952,7 -1942,7 +1952,7 @@@ $wgDBTableOptions = 'ENGINE=InnoDB, DEF
  $wgSQLMode = '';
  
  /**
 - * Mediawiki schema
 + * Mediawiki schema; this should be alphanumeric and not contain spaces nor hyphens
   */
  $wgDBmwschema = null;
  
@@@ -2164,15 -2154,7 +2164,15 @@@ $wgDBOracleDRCP = false
  /**
   * Other wikis on this site, can be administered from a single developer account.
   *
 - * Array numeric key => database name
 + * @var string[] List of wiki DB domain IDs; the format of each ID consist of 1-3 hyphen
 + *   delimited alphanumeric components (each with no hyphens nor spaces) of any of the forms:
 + *   - "<DB NAME>-<DB SCHEMA>-<TABLE PREFIX>"
 + *   - "<DB NAME>-<TABLE PREFIX>"
 + *   - "<DB NAME>"
 + * If hyphens appear in any of the components, then the domain ID parsing may not work
 + * in all cases and site functionality might be affected. If the schema ($wgDBmwschema)
 + * is left to the default "mediawiki" for all wikis, then the schema should be omitted
 + * from these IDs.
   */
  $wgLocalDatabases = [];
  
@@@ -2754,7 -2736,6 +2754,7 @@@ $wgUseSquid = false
  
  /**
   * If you run Squid3 with ESI support, enable this (default:false):
 + * @deprecated in 1.33. This was a now-defunct experimental feature.
   */
  $wgUseESI = false;
  
@@@ -2868,7 -2849,6 +2868,7 @@@ $wgSquidServersNoPurge = []
   * reverse).
   *
   * @since 1.21
 + * @deprecated since 1.33, will always be true in a future release.
   */
  $wgSquidPurgeUseHostHeader = true;
  
   * @endcode
   *
   * @since 1.22
 - *
 - * $wgHTCPRouting replaces $wgHTCPMulticastRouting that was introduced in 1.20.
 - * For back compatibility purposes, whenever its array is empty
 - * $wgHTCPMutlicastRouting will be used as a fallback if it not null.
 - *
   * @see $wgHTCPMulticastTTL
   */
  $wgHTCPRouting = [];
@@@ -3017,11 -3002,8 +3017,11 @@@ $wgExtraLanguageNames = []
   * @since 1.29
   */
  $wgExtraLanguageCodes = [
 +      // Language codes of macro languages, which get mapped to the main language
        'bh' => 'bho', // Bihari language family
        'no' => 'nb', // Norwegian language family
 +
 +      // Language variants which get mapped to the main language
        'simple' => 'en', // Simple English
  ];
  
@@@ -3040,8 -3022,6 +3040,8 @@@ $wgDummyLanguageCodes = []
   *
   * Note that pages with titles containing presentation forms will become
   * inaccessible, run maintenance/cleanupTitles.php to fix this.
 + *
 + * @deprecated since 1.33: in the future will always be true.
   */
  $wgFixArabicUnicode = true;
  
   *
   * If you enable this on an existing wiki, run maintenance/cleanupTitles.php to
   * fix any ZWJ sequences in existing page titles.
 + *
 + * @deprecated since 1.33: in the future will always be true.
   */
  $wgFixMalayalamUnicode = true;
  
@@@ -4263,10 -4241,8 +4263,10 @@@ $wgAllowExternalImagesFrom = ''
   *
   * Set this to true to enable the on-wiki whitelist (MediaWiki:External image whitelist)
   * Or false to disable it
 + *
 + * @since 1.14
   */
 -$wgEnableImageWhitelist = true;
 +$wgEnableImageWhitelist = false;
  
  /**
   * A different approach to the above: simply allow the "<img>" tag to be used.
@@@ -4591,6 -4567,10 +4591,6 @@@ $wgAuthManagerConfig = null
   */
  $wgAuthManagerAutoConfig = [
        'preauth' => [
 -              MediaWiki\Auth\LegacyHookPreAuthenticationProvider::class => [
 -                      'class' => MediaWiki\Auth\LegacyHookPreAuthenticationProvider::class,
 -                      'sort' => 0,
 -              ],
                MediaWiki\Auth\ThrottlePreAuthenticationProvider::class => [
                        'class' => MediaWiki\Auth\ThrottlePreAuthenticationProvider::class,
                        'sort' => 0,
@@@ -4907,6 -4887,7 +4907,6 @@@ $wgDefaultUserOptions = 
        'rows' => 25, // @deprecated since 1.29 No longer used in core
        'showhiddencats' => 0,
        'shownumberswatching' => 1,
 -      'showtoolbar' => 1,
        'skin' => false,
        'stubthreshold' => 0,
        'thumbsize' => 5,
@@@ -6190,6 -6171,7 +6190,6 @@@ $wgTrxProfilerLimits = 
                'maxAffected' => 1000
        ],
        'POST-nonwrite' => [
 -              'masterConns' => 0,
                'writes' => 0,
                'readQueryTime' => 5,
                'readQueryRows' => 10000
@@@ -9031,30 -9013,8 +9031,18 @@@ $wgActorTableSchemaMigrationStage = SCH
   * @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
 + * or namespaces.
 + *
 + * @since 1.32
 + * @deprecated 1.32
 + * @var bool
 + */
 +$wgEnablePartialBlocks = false;
 +
  /**
   * For really cool vim folding this needs to be at the end:
   * vim: foldmarker=@{,@} foldmethod=marker
@@@ -351,15 -351,13 +351,15 @@@ class ChangeTags 
                                foreach ( $tagsToAdd as $tag ) {
                                        $changeTagMapping[$tag] = $changeTagDefStore->acquireId( $tag );
                                }
 -
 -                              $dbw->update(
 -                                      'change_tag_def',
 -                                      [ 'ctd_count = ctd_count + 1' ],
 -                                      [ 'ctd_name' => $tagsToAdd ],
 -                                      __METHOD__
 -                              );
 +                              // T207881: update the counts at the end of the transaction
 +                              $dbw->onTransactionPreCommitOrIdle( function () use ( $dbw, $tagsToAdd ) {
 +                                      $dbw->update(
 +                                              'change_tag_def',
 +                                              [ 'ctd_count = ctd_count + 1' ],
 +                                              [ 'ctd_name' => $tagsToAdd ],
 +                                              __METHOD__
 +                                      );
 +                              } );
                        }
  
                        $tagsRows = [];
                                );
                                $dbw->delete( 'change_tag', $conds, __METHOD__ );
                                if ( $dbw->affectedRows() && $wgChangeTagsSchemaMigrationStage > MIGRATION_OLD ) {
 -                                      $dbw->update(
 -                                              'change_tag_def',
 -                                              [ 'ctd_count = ctd_count - 1' ],
 -                                              [ 'ctd_name' => $tag ],
 -                                              __METHOD__
 -                                      );
 -
 -                                      $dbw->delete(
 -                                              'change_tag_def',
 -                                              [ 'ctd_name' => $tag, 'ctd_count' => 0, 'ctd_user_defined' => 0 ],
 -                                              __METHOD__
 -                                      );
 +                                      // T207881: update the counts at the end of the transaction
 +                                      $dbw->onTransactionPreCommitOrIdle( function () use ( $dbw, $tag ) {
 +                                              $dbw->update(
 +                                                      'change_tag_def',
 +                                                      [ 'ctd_count = ctd_count - 1' ],
 +                                                      [ 'ctd_name' => $tag ],
 +                                                      __METHOD__
 +                                              );
 +
 +                                              $dbw->delete(
 +                                                      'change_tag_def',
 +                                                      [ 'ctd_name' => $tag, 'ctd_count' => 0, 'ctd_user_defined' => 0 ],
 +                                                      __METHOD__
 +                                              );
 +                                      } );
                                }
                        }
                }
                $tagTables[] = 'change_tag';
                if ( $wgChangeTagsSchemaMigrationStage > MIGRATION_WRITE_BOTH ) {
                        $tagTables[] = 'change_tag_def';
 -                      $join_cond_ts_tags = [ $join_cond, 'ct_tag_id=ctd_id' ];
 +                      $join_cond_ts_tags = [ 'change_tag_def' => [ 'INNER JOIN', 'ct_tag_id=ctd_id' ] ];
                        $field = 'ctd_name';
                } else {
                        $field = 'ct_tag';
 -                      $join_cond_ts_tags = $join_cond;
 +                      $join_cond_ts_tags = [];
                }
  
                $fields['ts_tags'] = wfGetDB( DB_REPLICA )->buildGroupConcatField(
 -                      ',', $tagTables, $field, $join_cond_ts_tags
 +                      ',', $tagTables, $field, $join_cond, $join_cond_ts_tags
                );
  
                if ( $wgUseTagFilter && $filter_tag ) {
         * @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();
                }