=== Other changes in 1.33 ===
* (T208871) The hard-coded Google search form on the database error page was
removed.
+* The image_comment_temp database table, deprecated in 1.32, has been removed.
+ Since access should be mediated by the CommentStore class, this change
+ shouldn't affect external code.
* …
== Compatibility ==
'deprecatedIn' => null,
],
'img_description' => [
- 'table' => 'image_comment_temp',
- 'pk' => 'imgcomment_name',
- 'field' => 'imgcomment_description_id',
- 'joinPK' => 'img_name',
- 'stage' => MIGRATION_WRITE_NEW,
+ 'stage' => MIGRATION_NEW,
'deprecatedIn' => '1.32',
],
];
if ( $tempTableStage === MIGRATION_OLD ) {
$joinField = "{$alias}.{$t['field']}";
} else {
+ // Nothing hits this code path for now, but will in the future when we set
+ // $this->tempTables['rev_comment']['stage'] to MIGRATION_WRITE_NEW while
+ // merging revision_comment_temp into revision.
+ // @codeCoverageIgnoreStart
$joins[$alias][0] = 'LEFT JOIN';
$joinField = "(CASE WHEN {$key}_id != 0 THEN {$key}_id ELSE {$alias}.{$t['field']} END)";
+ throw new LogicException( 'Nothing should reach this code path at this time' );
+ // @codeCoverageIgnoreEnd
}
} else {
$joinField = "{$key}_id";
if ( !$revision->isCurrent() ) {
$this->mArticle->setOldSubtitle( $revision->getId() );
- $out->addWikiMsg( 'editingold' );
+ $out->wrapWikiMsg(
+ Html::warningBox( "\n$1\n" ),
+ 'editingold'
+ );
$this->isOldRev = true;
}
} elseif ( $this->mTitle->exists() ) {
$fields['oi_description'] = 'img_description';
}
if ( $wgCommentTableSchemaMigrationStage >= MIGRATION_WRITE_BOTH ) {
- $tables[] = 'image_comment_temp';
- $fields['oi_description_id'] = 'CASE WHEN img_description_id = 0 '
- . 'THEN COALESCE(imgcomment_description_id, 0) ELSE img_description_id END';
- $joins['image_comment_temp'] = [
- $wgCommentTableSchemaMigrationStage === MIGRATION_NEW ? 'JOIN' : 'LEFT JOIN',
- [ 'imgcomment_name = img_name' ]
- ];
+ $fields['oi_description_id'] = 'img_description_id';
}
if ( $wgCommentTableSchemaMigrationStage !== MIGRATION_OLD &&
// might be missed if a deletion happens while the migration script
// is running.
$res = $dbw->select(
- [ 'image', 'image_comment_temp' ],
+ [ 'image' ],
[ 'img_name', 'img_description' ],
[
'img_name' => $this->getName(),
- 'imgcomment_name' => null,
'img_description_id' => 0,
],
- __METHOD__,
- [],
- [ 'image_comment_temp' => [ 'LEFT JOIN', [ 'imgcomment_name = img_name' ] ] ]
+ __METHOD__
);
foreach ( $res as $row ) {
$imgFields = $commentStore->insert( $dbw, 'img_description', $row->img_description );
[ 'img_name' => $this->getName() ],
__METHOD__
);
- if ( $wgCommentTableSchemaMigrationStage > MIGRATION_OLD ) {
- // Clear deprecated table row
- $dbw->delete( 'image_comment_temp', [ 'imgcomment_name' => $this->getName() ], __METHOD__ );
- }
}
$descTitle = $this->getTitle();
$fields['fa_description'] = 'img_description';
}
if ( $wgCommentTableSchemaMigrationStage >= MIGRATION_WRITE_BOTH ) {
- $tables[] = 'image_comment_temp';
- $fields['fa_description_id'] = 'CASE WHEN img_description_id = 0 '
- . 'THEN COALESCE(imgcomment_description_id, 0) ELSE img_description_id END';
- $joins['image_comment_temp'] = [
- $wgCommentTableSchemaMigrationStage === MIGRATION_NEW ? 'JOIN' : 'LEFT JOIN',
- [ 'imgcomment_name = img_name' ]
- ];
+ $fields['fa_description_id'] = 'img_description_id';
}
if ( $wgCommentTableSchemaMigrationStage !== MIGRATION_OLD &&
// might be missed if a deletion happens while the migration script
// is running.
$res = $dbw->select(
- [ 'image', 'image_comment_temp' ],
+ [ 'image' ],
[ 'img_name', 'img_description' ],
[
'img_name' => $this->file->getName(),
- 'imgcomment_name' => null,
'img_description_id' => 0,
],
- __METHOD__,
- [],
- [ 'image_comment_temp' => [ 'LEFT JOIN', [ 'imgcomment_name = img_name' ] ] ]
+ __METHOD__
);
foreach ( $res as $row ) {
$imgFields = $commentStore->insert( $dbw, 'img_description', $row->img_description );
}
function doDBDeletes() {
- global $wgCommentTableSchemaMigrationStage;
-
$dbw = $this->file->repo->getMasterDB();
list( $oldRels, $deleteCurrent ) = $this->getOldRels();
if ( $deleteCurrent ) {
$dbw->delete( 'image', [ 'img_name' => $this->file->getName() ], __METHOD__ );
- if ( $wgCommentTableSchemaMigrationStage > MIGRATION_OLD ) {
- // Clear deprecated table row
- $dbw->delete(
- 'image_comment_temp', [ 'imgcomment_name' => $this->file->getName() ], __METHOD__
- );
- }
}
}
* many rows where updated.
*/
protected function doDBUpdates() {
- global $wgCommentTableSchemaMigrationStage;
-
$dbw = $this->db;
// Update current image
[ 'img_name' => $this->oldName ],
__METHOD__
);
- if ( $wgCommentTableSchemaMigrationStage > MIGRATION_OLD ) {
- $dbw->update(
- 'image_comment_temp',
- [ 'imgcomment_name' => $this->newName ],
- [ 'imgcomment_name' => $this->oldName ],
- __METHOD__
- );
- }
// Update old images
$dbw->update(
*/
protected function migrateImageCommentTemp() {
global $wgCommentTableSchemaMigrationStage;
- if ( $wgCommentTableSchemaMigrationStage > MIGRATION_OLD ) {
- $this->output( "Merging image_comment_temp into the image table\n" );
- $task = $this->maintenance->runChild(
- MigrateImageCommentTemp::class, 'migrateImageCommentTemp.php'
- );
- $ok = $task->execute();
- $this->output( $ok ? "done.\n" : "errors were encountered.\n" );
+
+ if ( $this->tableExists( 'image_comment_temp' ) ) {
+ if ( $wgCommentTableSchemaMigrationStage > MIGRATION_OLD ) {
+ $this->output( "Merging image_comment_temp into the image table\n" );
+ $task = $this->maintenance->runChild(
+ MigrateImageCommentTemp::class, 'migrateImageCommentTemp.php'
+ );
+ $task->setForce();
+ $ok = $task->execute();
+ $this->output( $ok ? "done.\n" : "errors were encountered.\n" );
+ } else {
+ $ok = true;
+ }
+ if ( $ok ) {
+ $this->dropTable( 'image_comment_temp' );
+ }
}
}
$defaultPreferences['hideminor'] = [
'type' => 'toggle',
'label-message' => 'tog-hideminor',
- 'section' => 'rc/advancedrc',
+ 'section' => 'rc/changesrc',
];
$defaultPreferences['rcfilters-rc-collapsed'] = [
'type' => 'api',
$defaultPreferences['hidecategorization'] = [
'type' => 'toggle',
'label-message' => 'tog-hidecategorization',
- 'section' => 'rc/advancedrc',
+ 'section' => 'rc/changesrc',
];
}
if ( $user->useRCPatrol() ) {
$defaultPreferences['hidepatrolled'] = [
'type' => 'toggle',
- 'section' => 'rc/advancedrc',
+ 'section' => 'rc/changesrc',
'label-message' => 'tog-hidepatrolled',
];
}
if ( $user->useNPPatrol() ) {
$defaultPreferences['newpageshidepatrolled'] = [
'type' => 'toggle',
- 'section' => 'rc/advancedrc',
+ 'section' => 'rc/changesrc',
'label-message' => 'tog-newpageshidepatrolled',
];
}
];
$defaultPreferences['watchlisthideminor'] = [
'type' => 'toggle',
- 'section' => 'watchlist/advancedwatchlist',
+ 'section' => 'watchlist/changeswatchlist',
'label-message' => 'tog-watchlisthideminor',
];
$defaultPreferences['watchlisthidebots'] = [
'type' => 'toggle',
- 'section' => 'watchlist/advancedwatchlist',
+ 'section' => 'watchlist/changeswatchlist',
'label-message' => 'tog-watchlisthidebots',
];
$defaultPreferences['watchlisthideown'] = [
'type' => 'toggle',
- 'section' => 'watchlist/advancedwatchlist',
+ 'section' => 'watchlist/changeswatchlist',
'label-message' => 'tog-watchlisthideown',
];
$defaultPreferences['watchlisthideanons'] = [
'type' => 'toggle',
- 'section' => 'watchlist/advancedwatchlist',
+ 'section' => 'watchlist/changeswatchlist',
'label-message' => 'tog-watchlisthideanons',
];
$defaultPreferences['watchlisthideliu'] = [
'type' => 'toggle',
- 'section' => 'watchlist/advancedwatchlist',
+ 'section' => 'watchlist/changeswatchlist',
'label-message' => 'tog-watchlisthideliu',
];
if ( $this->config->get( 'RCWatchCategoryMembership' ) ) {
$defaultPreferences['watchlisthidecategorization'] = [
'type' => 'toggle',
- 'section' => 'watchlist/advancedwatchlist',
+ 'section' => 'watchlist/changeswatchlist',
'label-message' => 'tog-watchlisthidecategorization',
];
}
if ( $user->useRCPatrol() ) {
$defaultPreferences['watchlisthidepatrolled'] = [
'type' => 'toggle',
- 'section' => 'watchlist/advancedwatchlist',
+ 'section' => 'watchlist/changeswatchlist',
'label-message' => 'tog-watchlisthidepatrolled',
];
}
// tog-watchrollback
$defaultPreferences[$pref] = [
'type' => 'toggle',
- 'section' => 'watchlist/advancedwatchlist',
+ 'section' => 'watchlist/pageswatchlist',
'label-message' => "tog-$pref",
];
}
"prefs-advancedwatchlist": "Advanced options",
"prefs-displayrc": "Display options",
"prefs-displaywatchlist": "Display options",
+ "prefs-changesrc": "Changes shown",
+ "prefs-changeswatchlist": "Changes shown",
+ "prefs-pageswatchlist": "Watched pages",
"prefs-tokenwatchlist": "Token",
"prefs-diffs": "Diffs",
"prefs-help-prefershttps": "This preference will take effect on your next login.",
"prefs-advancedwatchlist": "Used in [[Special:Preferences]], tab \"Watchlist\".\n{{Identical|Advanced options}}",
"prefs-displayrc": "\"Display\" is a noun that specifies the kind of \"options\". So translate as \"options about display\", not as \"display the options\".\n\nUsed in [[Special:Preferences]], tab \"Recent changes\". The display options refer to:\n* {{msg-mw|Recentchangesdays}}\n* {{msg-mw|Recentchangescount}}",
"prefs-displaywatchlist": "\"Display\" is a noun that specifies the kind of \"options\". So translate as \"options about display\", not as \"display the options\".\n\nUsed in [[Special:Preferences]], tab \"Watchlist\". The display options refer to:\n* {{msg-mw|Prefs-watchlist-days}}\n* {{msg-mw|Prefs-watchlist-edits}}",
+ "prefs-changesrc": "Section heading in [[Special:Preferences]], tab \"Recent changes\". Describes the types of changes/edits that will be shown on Special:RecentChanges (the heading is followed by a list of checkboxes).",
+ "prefs-changeswatchlist": "Section heading in [[Special:Preferences]], tab \"Watchlist\". Describes the types of changes/edits that will be shown on Special:Watchlist (the heading is followed by a list of checkboxes).",
+ "prefs-pageswatchlist": "Section heading in [[Special:Preferences]], tab \"Watchlist\". Describes the types of pages that will be automatically added to the watchlist (the heading is followed by a list of checkboxes).",
"prefs-tokenwatchlist": "Section heading.\nUsed in [[Special:Preferences]], tab \"Watchlist\".\n{{Identical|Token}}",
"prefs-diffs": "Used in [[Special:Preferences]], tab \"Misc\".\n{{Identical|Diff}}",
"prefs-help-prefershttps": "Used as help text for the checkbox in [[Special:Preferences]].\n\nThe checkbox has the label {{msg-mw|Tog-prefershttps}}.\n\nSee example: [[mw:Special:Preferences]].",
*
*/
-$fallback = 'bo'; // Tibetian
+$fallback = 'my';
-- Used to get media of one type
CREATE INDEX /*i*/img_media_mime ON /*_*/image (img_media_type,img_major_mime,img_minor_mime);
---
--- Temporary table to avoid blocking on an alter of image.
---
--- On large wikis like Wikimedia Commons, altering the image table is a
--- months-long process. This table is being created to avoid such an alter, and
--- will be merged back into image in the future.
---
-CREATE TABLE /*_*/image_comment_temp (
- imgcomment_name nvarchar(255) NOT NULL CONSTRAINT FK_imgcomment_name FOREIGN KEY REFERENCES /*_*/image(img_name) ON DELETE CASCADE,
- imgcomment_description_id bigint NOT NULL CONSTRAINT FK_imgcomment_description_id FOREIGN KEY REFERENCES /*_*/comment(comment_id),
- CONSTRAINT PK_image_comment_temp PRIMARY KEY (imgcomment_name, imgcomment_description_id)
-);
-CREATE UNIQUE INDEX /*i*/imgcomment_name ON /*_*/image_comment_temp (imgcomment_name);
-
--
-- Previous revisions of uploaded files.
CREATE INDEX &mw_prefix.image_i04 ON &mw_prefix.image (img_sha1);
CREATE INDEX &mw_prefix.img_actor_timestamp ON &mw_prefix.image (img_actor, img_timestamp);
-CREATE TABLE &mw_prefix.image_comment_temp (
- imgcomment_name VARCHAR2(255) NOT NULL,
- imgcomment_description_id NUMBER NOT NULL
-);
-ALTER TABLE &mw_prefix.image_comment_temp ADD CONSTRAINT &mw_prefix.image_comment_temp_pk PRIMARY KEY (imgcomment_name, imgcomment_description_id);
-ALTER TABLE &mw_prefix.image_comment_temp ADD CONSTRAINT &mw_prefix.image_comment_temp_fk1 FOREIGN KEY (imgcomment_name) REFERENCES &mw_prefix.image(img_name) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
-ALTER TABLE &mw_prefix.image_comment_temp ADD CONSTRAINT &mw_prefix.image_comment_temp_fk2 FOREIGN KEY (imgcomment_description_id) REFERENCES &mw_prefix."COMMENT"(comment_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
-CREATE UNIQUE INDEX &mw_prefix.imgcomment_name ON &mw_prefix.image_comment_temp (imgcomment_name);
-
CREATE TABLE &mw_prefix.oldimage (
oi_name VARCHAR2(255) DEFAULT 0 NOT NULL,
CREATE INDEX img_timestamp_idx ON image (img_timestamp);
CREATE INDEX img_sha1 ON image (img_sha1);
-CREATE TABLE image_comment_temp (
- imgcomment_name TEXT NOT NULL,
- imgcomment_description_id INTEGER NOT NULL,
- PRIMARY KEY (imgcomment_name, imgcomment_description_id)
-);
-CREATE UNIQUE INDEX imgcomment_name ON image_comment_temp (imgcomment_name);
-
CREATE TABLE oldimage (
oi_name TEXT NOT NULL,
oi_archive_name TEXT NOT NULL,
-- Used to get media of one type
CREATE INDEX /*i*/img_media_mime ON /*_*/image (img_media_type,img_major_mime,img_minor_mime);
---
--- Temporary table to avoid blocking on an alter of image.
---
--- On large wikis like Wikimedia Commons, altering the image table is a
--- months-long process. This table is being created to avoid such an alter, and
--- will be merged back into image in the future.
---
-CREATE TABLE /*_*/image_comment_temp (
- -- Key to img_name (ugh)
- imgcomment_name varchar(255) binary NOT NULL,
- -- Key to comment_id
- imgcomment_description_id bigint unsigned NOT NULL,
- PRIMARY KEY (imgcomment_name, imgcomment_description_id)
-) /*$wgDBTableOptions*/;
--- Ensure uniqueness
-CREATE UNIQUE INDEX /*i*/imgcomment_name ON /*_*/image_comment_temp (imgcomment_name);
-
--
-- Previous revisions of uploaded files.
// The new tables for comments are in use
$tables[] = 'comment';
$tables[] = 'revision_comment_temp';
- $tables[] = 'image_comment_temp';
}
if ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_WRITE_NEW ) {
MIGRATION_WRITE_BOTH, 'img_description',
[
'img_description_old' => 'img_description',
- 'img_description_pk' => 'img_name',
'img_description_id' => 'img_description_id'
],
],
MIGRATION_WRITE_NEW, 'img_description',
[
'img_description_old' => 'img_description',
- 'img_description_pk' => 'img_name',
'img_description_id' => 'img_description_id'
],
],
'Image, new' => [
MIGRATION_NEW, 'img_description',
[
- 'img_description_pk' => 'img_name',
'img_description_id' => 'img_description_id'
],
],
'Image, write-both' => [
MIGRATION_WRITE_BOTH, 'img_description', [
'tables' => [
- 'temp_img_description' => 'image_comment_temp',
'comment_img_description' => 'comment',
],
'fields' => [
'img_description_cid' => 'comment_img_description.comment_id',
],
'joins' => [
- 'temp_img_description' => [ 'LEFT JOIN', 'temp_img_description.imgcomment_name = img_name' ],
'comment_img_description' => [ 'LEFT JOIN',
- // phpcs:ignore Generic.Files.LineLength
- 'comment_img_description.comment_id = (CASE WHEN img_description_id != 0 THEN img_description_id ELSE temp_img_description.imgcomment_description_id END)',
+ 'comment_img_description.comment_id = img_description_id',
],
],
],
'Image, write-new' => [
MIGRATION_WRITE_NEW, 'img_description', [
'tables' => [
- 'temp_img_description' => 'image_comment_temp',
'comment_img_description' => 'comment',
],
'fields' => [
'img_description_cid' => 'comment_img_description.comment_id',
],
'joins' => [
- 'temp_img_description' => [ 'LEFT JOIN', 'temp_img_description.imgcomment_name = img_name' ],
'comment_img_description' => [ 'LEFT JOIN',
- // phpcs:ignore Generic.Files.LineLength
- 'comment_img_description.comment_id = (CASE WHEN img_description_id != 0 THEN img_description_id ELSE temp_img_description.imgcomment_description_id END)',
+ 'comment_img_description.comment_id = img_description_id',
],
],
],
'Image, new' => [
MIGRATION_NEW, 'img_description', [
'tables' => [
- 'temp_img_description' => 'image_comment_temp',
'comment_img_description' => 'comment',
],
'fields' => [
'img_description_cid' => 'comment_img_description.comment_id',
],
'joins' => [
- 'temp_img_description' => [ 'LEFT JOIN', 'temp_img_description.imgcomment_name = img_name' ],
'comment_img_description' => [ 'JOIN',
- // phpcs:ignore Generic.Files.LineLength
- 'comment_img_description.comment_id = (CASE WHEN img_description_id != 0 THEN img_description_id ELSE temp_img_description.imgcomment_description_id END)',
+ 'comment_img_description.comment_id = img_description_id',
],
],
],