diff --git a/Core/Controller/Updater.php b/Core/Controller/Updater.php index e414434de3..f169e4c51f 100644 --- a/Core/Controller/Updater.php +++ b/Core/Controller/Updater.php @@ -156,8 +156,20 @@ private function disableBetaUpdatesAction(): void */ private function downloadAction(): void { - $idItem = $this->request->get('item', ''); $this->updaterItems = self::getUpdateItems(); + + $idItem = $this->request->query('item', ''); + $this->downloadPlugin($idItem); + + // ¿Hay que desactivar algo? + $disable = $this->request->query('disable', ''); + foreach (explode(',', $disable) as $plugin) { + Plugins::disable($plugin); + } + } + + private function downloadPlugin($idItem): void + { foreach ($this->updaterItems as $key => $item) { if ($item['id'] != $idItem) { continue; @@ -176,16 +188,19 @@ private function downloadAction(): void } Tools::log()->error('download-error', [ - '%body%' => $http->body(), + '%body%' => $http->body() . ' - ' . 'Plugin ' . $item['name'], '%error%' => $http->errorMessage(), '%status%' => $http->status(), ]); } + } - // ¿Hay que desactivar algo? - $disable = $this->request->get('disable', ''); - foreach (explode(',', $disable) as $plugin) { - Plugins::disable($plugin); + private function downloadAllPluginsAction(): void + { + $this->updaterItems = self::getUpdateItems(); + + foreach ($this->updaterItems as $updater_item) { + $this->downloadPlugin($updater_item['id']); } } @@ -208,6 +223,10 @@ protected function execAction(string $action): void $this->downloadAction(); return; + case 'download-all-plugins': + $this->downloadAllPluginsAction(); + break; + case 'post-update': $this->postUpdateAction(); break; diff --git a/Core/View/Updater.html.twig b/Core/View/Updater.html.twig index bacf948888..ae58a80900 100644 --- a/Core/View/Updater.html.twig +++ b/Core/View/Updater.html.twig @@ -72,6 +72,16 @@
+ {% set hasUndownloaded = fsc.updaterItems|reduce((carry, item) => carry or not item.downloaded, false) %} + {% if hasUndownloaded %} + + {% endif %}