Merge "Remove deprecated module alias "jquery.byteLimit""
[lhc/web/wiklou.git] / includes / installer / DatabaseUpdater.php
index 0194822..43000b8 100644 (file)
@@ -87,6 +87,7 @@ abstract class DatabaseUpdater {
                AddRFCandPMIDInterwiki::class,
                PopulatePPSortKey::class,
                PopulateIpChanges::class,
+               RefreshExternallinksIndex::class,
        ];
 
        /**
@@ -164,10 +165,7 @@ abstract class DatabaseUpdater {
 
                // This will automatically add "AutoloadClasses" to $wgAutoloadClasses
                $data = $registry->readFromQueue( $queue );
-               $hooks = [];
-               if ( isset( $data['globals']['wgHooks']['LoadExtensionSchemaUpdates'] ) ) {
-                       $hooks = $data['globals']['wgHooks']['LoadExtensionSchemaUpdates'];
-               }
+               $hooks = $data['globals']['wgHooks']['LoadExtensionSchemaUpdates'] ?? [];
                if ( $vars && isset( $vars['wgHooks']['LoadExtensionSchemaUpdates'] ) ) {
                        $hooks = array_merge_recursive( $hooks, $vars['wgHooks']['LoadExtensionSchemaUpdates'] );
                }
@@ -1284,13 +1282,22 @@ abstract class DatabaseUpdater {
         */
        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' );
+                       }
                }
        }