From: Brad Jorsch Date: Wed, 14 Aug 2019 15:57:12 +0000 (-0400) Subject: maintenance/populateChangeTagDef.php: Handle missing valid_tags table X-Git-Tag: 1.34.0-rc.0~719^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/%7B%7Bpath%7D%7Dmw-config/index.%7B%7Bext%7D%7D?a=commitdiff_plain;h=c910b9b43a65ba14b8d1775b202b5eac63322171;p=lhc%2Fweb%2Fwiklou.git 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 --- 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" );