From 3278ff03e7809dd0bb31771b3928e8676a09c572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Bartus?= Date: Sun, 27 Mar 2016 18:25:06 +0200 Subject: [PATCH 1/3] [ticket/14393] Fix updater behaviour PHPBB3-14393 --- .../install/module/update_database/task/update.php | 2 +- .../module/update_filesystem/task/file_check.php | 1 + .../module/update_filesystem/task/show_file_status.php | 10 +++++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/phpBB/phpbb/install/module/update_database/task/update.php b/phpBB/phpbb/install/module/update_database/task/update.php index 4b2baf2c23..d8807951d1 100644 --- a/phpBB/phpbb/install/module/update_database/task/update.php +++ b/phpBB/phpbb/install/module/update_database/task/update.php @@ -183,7 +183,7 @@ class update extends task_base ); } - $this->iohandler->finish_progress('INLINE_UPDATE_SUCCESSFUL'); + $this->iohandler->set_progress('INLINE_UPDATE_SUCCESSFUL', $migration_count); $this->iohandler->add_success_message('INLINE_UPDATE_SUCCESSFUL'); diff --git a/phpBB/phpbb/install/module/update_filesystem/task/file_check.php b/phpBB/phpbb/install/module/update_filesystem/task/file_check.php index 5dbee6c259..f4b3870148 100644 --- a/phpBB/phpbb/install/module/update_filesystem/task/file_check.php +++ b/phpBB/phpbb/install/module/update_filesystem/task/file_check.php @@ -166,6 +166,7 @@ class file_check extends task_base } $this->installer_config->set('update_files', $file_update_info); + $this->installer_config->set('update_info', array()); } /** diff --git a/phpBB/phpbb/install/module/update_filesystem/task/show_file_status.php b/phpBB/phpbb/install/module/update_filesystem/task/show_file_status.php index c46c05500a..329e6b9315 100644 --- a/phpBB/phpbb/install/module/update_filesystem/task/show_file_status.php +++ b/phpBB/phpbb/install/module/update_filesystem/task/show_file_status.php @@ -140,10 +140,14 @@ class show_file_status extends task_base } else { + $this->file_updater->close(); + $conflict_archive_path = $this->installer_config->get('update_file_conflict_archive', null); + // Remove archive - $this->filesystem->remove( - $this->installer_config->get('update_file_conflict_archive', null) - ); + if ($conflict_archive_path !== null && $this->filesystem->exists($conflict_archive_path)) + { + $this->filesystem->remove($conflict_archive_path); + } $this->installer_config->set('update_file_conflict_archive', null); } From c44a01fd9deba39b43bcaf6979483a5b82bf364e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Bartus?= Date: Sun, 27 Mar 2016 20:10:45 +0200 Subject: [PATCH 2/3] [ticket/14393] Fix init for conflict archive PHPBB3-14393 --- .../update_filesystem/task/show_file_status.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/phpBB/phpbb/install/module/update_filesystem/task/show_file_status.php b/phpBB/phpbb/install/module/update_filesystem/task/show_file_status.php index 329e6b9315..7f18950cf6 100644 --- a/phpBB/phpbb/install/module/update_filesystem/task/show_file_status.php +++ b/phpBB/phpbb/install/module/update_filesystem/task/show_file_status.php @@ -66,11 +66,7 @@ class show_file_status extends task_base $this->cache = $container->get('cache.driver'); // Initialize compression file updater - $compression_method = $this->installer_config->get('compression_method', ''); $this->file_updater = $file_updater_factory->get('compression'); - $conflict_archive = $this->file_updater->init($compression_method); - - $this->installer_config->set('update_file_conflict_archive', $conflict_archive); parent::__construct(false); } @@ -96,6 +92,10 @@ class show_file_status extends task_base // Create archive for merge conflicts if (!empty($merge_conflicts)) { + $compression_method = $this->installer_config->get('compression_method', ''); + $conflict_archive = $this->file_updater->init($compression_method); + $this->installer_config->set('update_file_conflict_archive', $conflict_archive); + foreach ($merge_conflicts as $filename) { $this->file_updater->create_new_file( @@ -111,9 +111,9 @@ class show_file_status extends task_base 'DOWNLOAD_CONFLICTS', 'DOWNLOAD_CONFLICTS_EXPLAIN' ); - } - $this->file_updater->close(); + $this->file_updater->close(); + } // Render update file statuses $file_update_info = $this->installer_config->get('update_files', array()); @@ -140,7 +140,6 @@ class show_file_status extends task_base } else { - $this->file_updater->close(); $conflict_archive_path = $this->installer_config->get('update_file_conflict_archive', null); // Remove archive From 9fc01a42e678a934507dede60b9e1e806ccfd787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Bartus?= Date: Wed, 30 Mar 2016 11:05:45 +0200 Subject: [PATCH 3/3] [ticket/14393] Fix db update progress bar PHPBB3-14393 --- phpBB/phpbb/install/module/update_database/task/update.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/phpBB/phpbb/install/module/update_database/task/update.php b/phpBB/phpbb/install/module/update_database/task/update.php index d8807951d1..9fed2317e9 100644 --- a/phpBB/phpbb/install/module/update_database/task/update.php +++ b/phpBB/phpbb/install/module/update_database/task/update.php @@ -142,6 +142,7 @@ class update extends task_base $this->migrator->set_migrations($migrations); $migration_count = count($this->migrator->get_migrations()); $this->iohandler->set_task_count($migration_count, true); + $this->installer_config->set_task_progress_count($migration_count); $progress_count = $this->installer_config->get('database_update_count', 0); while (!$this->migrator->finished()) @@ -183,8 +184,6 @@ class update extends task_base ); } - $this->iohandler->set_progress('INLINE_UPDATE_SUCCESSFUL', $migration_count); - $this->iohandler->add_success_message('INLINE_UPDATE_SUCCESSFUL'); $this->config->delete('version_update_from');