From 82fca7496febb35e0beaaba55cb502fe2ccb5676 Mon Sep 17 00:00:00 2001 From: Sebastien MALOT Date: Sat, 15 Oct 2016 02:50:47 +0200 Subject: [PATCH] fix #2756: maintain maintenance mode if previously enabled (#2757) --- src/Command/Update/ExecuteCommand.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Command/Update/ExecuteCommand.php b/src/Command/Update/ExecuteCommand.php index 167ba913c..24abf462c 100644 --- a/src/Command/Update/ExecuteCommand.php +++ b/src/Command/Update/ExecuteCommand.php @@ -125,15 +125,20 @@ protected function execute(InputInterface $input, OutputInterface $output) update_fix_compatibility(); $updates = update_get_update_list(); $this->checkUpdates($io); + $maintenance_mode = $this->state->get('system.maintenance_mode', false); - $io->info($this->trans('commands.site.maintenance.description')); - $this->state->set('system.maintenance_mode', true); + if (!$maintenance_mode) { + $io->info($this->trans('commands.site.maintenance.description')); + $this->state->set('system.maintenance_mode', true); + } $this->runUpdates($io, $updates); $this->runPostUpdates($io); - $this->state->set('system.maintenance_mode', false); - $io->info($this->trans('commands.site.maintenance.messages.maintenance-off')); + if (!$maintenance_mode) { + $this->state->set('system.maintenance_mode', false); + $io->info($this->trans('commands.site.maintenance.messages.maintenance-off')); + } $this->chainQueue ->addCommand('cache:rebuild', ['cache' => 'all']);