From c910b9b43a65ba14b8d1775b202b5eac63322171 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Wed, 14 Aug 2019 11:57:12 -0400 Subject: [PATCH] maintenance/populateChangeTagDef.php: Handle missing valid_tags table The valid_tags table was added in MW 1.15 and removed in 1.33. If someone is trying to upgrade from a really old version of MediaWiki, valid_tags may not exist even though change_tags.ct_tag does. Bug: T230317 Change-Id: Ib94542878b8d301c1d7f806405ee39838ebc6d4a --- maintenance/populateChangeTagDef.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/maintenance/populateChangeTagDef.php b/maintenance/populateChangeTagDef.php index 6c465977ad..2be690b08d 100644 --- a/maintenance/populateChangeTagDef.php +++ b/maintenance/populateChangeTagDef.php @@ -74,12 +74,15 @@ class PopulateChangeTagDef extends LoggedUpdateMaintenance { private function setUserDefinedTags() { $dbr = $this->lbFactory->getMainLB()->getConnection( DB_REPLICA ); - $userTags = $dbr->selectFieldValues( - 'valid_tag', - 'vt_tag', - [], - __METHOD__ - ); + $userTags = null; + if ( $dbr->tableExists( 'valid_tag' ) ) { + $userTags = $dbr->selectFieldValues( + 'valid_tag', + 'vt_tag', + [], + __METHOD__ + ); + } if ( empty( $userTags ) ) { $this->output( "No user defined tags to set, moving on...\n" ); -- 2.20.1