From b0f1078f12c6bfe2bfab1ebcc5dedc1bf84f4662 Mon Sep 17 00:00:00 2001 From: Benjamin Trenkle Date: Tue, 4 Nov 2025 22:14:00 +0100 Subject: [PATCH 1/5] Hide autoupdate box when installing languages --- installation/template/js/remove.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/installation/template/js/remove.js b/installation/template/js/remove.js index c430c7e7f7268..568d4b3d5fdc8 100644 --- a/installation/template/js/remove.js +++ b/installation/template/js/remove.js @@ -10,6 +10,7 @@ if (document.getElementById('installAddFeatures')) { document.getElementById('installAddFeatures').addEventListener('click', function(e) { e.preventDefault(); document.getElementById('installLanguages').classList.add('active'); + document.getElementById('automatedUpdates').classList.remove('active'); document.getElementById('installCongrat').classList.remove('active'); document.getElementById('installFinal').classList.remove('active'); document.getElementById('installRecommended').classList.remove('active'); @@ -19,6 +20,7 @@ if (document.getElementById('installAddFeatures')) { if (document.getElementById('skipLanguages')) { document.getElementById('skipLanguages').addEventListener('click', function(e) { e.preventDefault(); + document.getElementById('automatedUpdates').classList.add('active'); document.getElementById('installCongrat').classList.add('active'); document.getElementById('installFinal').classList.add('active'); document.getElementById('installRecommended').classList.add('active'); From 79c410a8614d5dbd1d365e5cac54a3eea5de2a06 Mon Sep 17 00:00:00 2001 From: Benjamin Trenkle Date: Tue, 4 Nov 2025 22:23:36 +0100 Subject: [PATCH 2/5] Fix loader when installing the language --- installation/template/js/remove.js | 17 ++++++++++++----- installation/template/js/template.js | 6 +++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/installation/template/js/remove.js b/installation/template/js/remove.js index 568d4b3d5fdc8..b57acab21834e 100644 --- a/installation/template/js/remove.js +++ b/installation/template/js/remove.js @@ -167,12 +167,19 @@ if (document.getElementById('installLanguagesButton')) { document.getElementById('installLanguagesButton').addEventListener('click', function(e) { e.preventDefault(); var form = document.getElementById('languagesForm'); - if (form) { + if (form) { + Joomla.removeMessages(); + document.body.appendChild(document.createElement('joomla-core-loader')); + // Install the extra languages - if (Joomla.install(['languages'], form)) { - document.getElementById('installLanguages').classList.remove('active'); - document.getElementById('installFinal').classList.add('active'); - } + try { + Joomla.install(['languages'], form, true); + } catch (err) { + const loader = document.querySelector('joomla-core-loader'); + if (loader) { + loader.remove(); + } + } } }) } diff --git a/installation/template/js/template.js b/installation/template/js/template.js index 568c45909ae9e..a8caefc4b2934 100644 --- a/installation/template/js/template.js +++ b/installation/template/js/template.js @@ -153,7 +153,7 @@ * * @param tasks An array of install tasks to execute */ - Joomla.install = function(tasks, form) { + Joomla.install = function(tasks, form, fromSubmit) { const progress = document.getElementById('progressbar'); const progress_text = document.getElementById('progress-text'); if (!form) { @@ -163,7 +163,7 @@ if (progress_text) { progress_text.innerText = Joomla.Text._('INSTL_FINISHED'); } - setTimeout(Joomla.goToPage, 2000, 'remove'); + setTimeout(Joomla.goToPage, 2000, 'remove', fromSubmit); return; } @@ -226,7 +226,7 @@ progress.setAttribute('value', parseInt(progress.getAttribute('value')) + 1); progress_text.innerText = Joomla.Text._('INSTL_IN_PROGRESS'); } - Joomla.install(tasks, form); + Joomla.install(tasks, form, fromSubmit); }, onError: function(xhr){ if (progress_text) { From e4f63f060d1cee1badac767f63797664655399e0 Mon Sep 17 00:00:00 2001 From: Benjamin Trenkle Date: Wed, 5 Nov 2025 23:25:26 +0100 Subject: [PATCH 3/5] Fix auto update disabled --- installation/src/Model/ChecksModel.php | 15 +++++++++++++++ installation/src/View/Remove/HtmlView.php | 10 ++++++++++ installation/template/js/remove.js | 4 ++-- installation/tmpl/remove/default.php | 4 ++++ 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/installation/src/Model/ChecksModel.php b/installation/src/Model/ChecksModel.php index 5f09dac2e1d24..ae820e727cf50 100644 --- a/installation/src/Model/ChecksModel.php +++ b/installation/src/Model/ChecksModel.php @@ -10,6 +10,7 @@ namespace Joomla\CMS\Installation\Model; +use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\Form\Form; use Joomla\CMS\Language\Text; @@ -253,4 +254,18 @@ public function getForm($view = null) return $form; } + + /** + * Check if auto updates are disabled + * + * @return boolean + * + * @since __DEPLOY_VERSION__ + */ + public function getAutoUpdatesDisabled(): bool + { + $updates = ComponentHelper::getParams('com_joomlaupdate'); + + return !$updates->get('autoupdate', 0) && !$updates->get('autoupdate_status', 0); + } } diff --git a/installation/src/View/Remove/HtmlView.php b/installation/src/View/Remove/HtmlView.php index 705caad32a5de..0c062f2b1035c 100644 --- a/installation/src/View/Remove/HtmlView.php +++ b/installation/src/View/Remove/HtmlView.php @@ -66,6 +66,14 @@ class HtmlView extends BaseHtmlView */ protected $installed_languages; + /** + * If updates are disabled, we hide the box + * + * @var boolean + * @since __DEPLOY_VERSION__ + */ + protected $autoUpdatesDisabled = false; + /** * Execute and display a template script. * @@ -92,6 +100,8 @@ public function display($tpl = null) $this->phpoptions = $checksModel->getPhpOptions(); $this->phpsettings = $checksModel->getPhpSettings(); + $this->autoUpdatesDisabled = $checksModel->getAutoUpdatesDisabled(); + parent::display($tpl); } } diff --git a/installation/template/js/remove.js b/installation/template/js/remove.js index b57acab21834e..3e72ecec592e1 100644 --- a/installation/template/js/remove.js +++ b/installation/template/js/remove.js @@ -10,7 +10,7 @@ if (document.getElementById('installAddFeatures')) { document.getElementById('installAddFeatures').addEventListener('click', function(e) { e.preventDefault(); document.getElementById('installLanguages').classList.add('active'); - document.getElementById('automatedUpdates').classList.remove('active'); + document.getElementById('automatedUpdates')?.classList?.remove('active'); document.getElementById('installCongrat').classList.remove('active'); document.getElementById('installFinal').classList.remove('active'); document.getElementById('installRecommended').classList.remove('active'); @@ -20,7 +20,7 @@ if (document.getElementById('installAddFeatures')) { if (document.getElementById('skipLanguages')) { document.getElementById('skipLanguages').addEventListener('click', function(e) { e.preventDefault(); - document.getElementById('automatedUpdates').classList.add('active'); + document.getElementById('automatedUpdates')?.classList?.add('active'); document.getElementById('installCongrat').classList.add('active'); document.getElementById('installFinal').classList.add('active'); document.getElementById('installRecommended').classList.add('active'); diff --git a/installation/tmpl/remove/default.php b/installation/tmpl/remove/default.php index cb7ddd493efa4..05ca4d7f7ca67 100644 --- a/installation/tmpl/remove/default.php +++ b/installation/tmpl/remove/default.php @@ -139,6 +139,8 @@ class="form-check-input" + autoUpdatesDisabled) : ?> +
@@ -152,6 +154,8 @@ class="form-check-input"
+ +
From c8a213867138a8b6c19dc830f3b75ba5354a3c96 Mon Sep 17 00:00:00 2001 From: Benjamin Trenkle Date: Wed, 5 Nov 2025 23:45:25 +0100 Subject: [PATCH 4/5] Code style fix --- installation/tmpl/remove/default.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/installation/tmpl/remove/default.php b/installation/tmpl/remove/default.php index 05ca4d7f7ca67..518260b96bc18 100644 --- a/installation/tmpl/remove/default.php +++ b/installation/tmpl/remove/default.php @@ -140,7 +140,6 @@ class="form-check-input" autoUpdatesDisabled) : ?> -
@@ -153,7 +152,6 @@ class="form-check-input"
-
From b3e7ed8bcf4281e70dda1306abc1bafe27dfae4a Mon Sep 17 00:00:00 2001 From: Benjamin Trenkle Date: Thu, 6 Nov 2025 02:52:33 +0100 Subject: [PATCH 5/5] Satisfy phpstan --- installation/tmpl/remove/default.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation/tmpl/remove/default.php b/installation/tmpl/remove/default.php index 518260b96bc18..99ff60cc1d3a3 100644 --- a/installation/tmpl/remove/default.php +++ b/installation/tmpl/remove/default.php @@ -139,7 +139,7 @@ class="form-check-input"
- autoUpdatesDisabled) : ?> + autoUpdatesDisabled)) : ?>