From c48fd3b8eb71c6dcf45cd08588b916514a492422 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Tue, 14 Jul 2026 15:30:03 -0500 Subject: [PATCH] fix(runbackup): a failed pre-update backup blocks the update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the pre-update/uninstall backup fails, the update must not run. The completion screen no longer offers "Continue without backup" on error — the only options are Retry (re-run the backup) or Back to dashboard (bail out without updating). The status message makes clear the update was not started. Claude-Session: https://claude.ai/code/session_01WbGBN9VyRK61zczYWcCQ2i --- .../language/en-GB/com_mokosuitebackup.ini | 1 + .../language/en-US/com_mokosuitebackup.ini | 1 + .../com_mokosuitebackup/tmpl/runbackup/default.php | 10 +++++----- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/source/packages/com_mokosuitebackup/language/en-GB/com_mokosuitebackup.ini b/source/packages/com_mokosuitebackup/language/en-GB/com_mokosuitebackup.ini index 824c6f0e..fa663c7f 100644 --- a/source/packages/com_mokosuitebackup/language/en-GB/com_mokosuitebackup.ini +++ b/source/packages/com_mokosuitebackup/language/en-GB/com_mokosuitebackup.ini @@ -356,6 +356,7 @@ COM_MOKOJOOMBACKUP_RUNBACKUP_CANCEL="Cancel backup" COM_MOKOJOOMBACKUP_RUNBACKUP_CANCEL_CONFIRM1="Cancel the backup that is in progress?" COM_MOKOJOOMBACKUP_RUNBACKUP_CANCEL_CONFIRM2="Are you sure? The backup will be stopped and the update will NOT continue." COM_MOKOJOOMBACKUP_RUNBACKUP_CANCELLING="Cancelling…" +COM_MOKOJOOMBACKUP_RUNBACKUP_FAILED_NO_UPDATE="Backup failed — the update was not started. Retry the backup, or go back without updating." COM_MOKOJOOMBACKUP_RUNBACKUP_CONTINUE_UPDATE="Continue the update" COM_MOKOJOOMBACKUP_CONFIG_CLEANUP="Cleanup Defaults" diff --git a/source/packages/com_mokosuitebackup/language/en-US/com_mokosuitebackup.ini b/source/packages/com_mokosuitebackup/language/en-US/com_mokosuitebackup.ini index 1f2d226d..61f2219d 100644 --- a/source/packages/com_mokosuitebackup/language/en-US/com_mokosuitebackup.ini +++ b/source/packages/com_mokosuitebackup/language/en-US/com_mokosuitebackup.ini @@ -78,6 +78,7 @@ COM_MOKOJOOMBACKUP_RUNBACKUP_CANCEL="Cancel backup" COM_MOKOJOOMBACKUP_RUNBACKUP_CANCEL_CONFIRM1="Cancel the backup that is in progress?" COM_MOKOJOOMBACKUP_RUNBACKUP_CANCEL_CONFIRM2="Are you sure? The backup will be stopped and the update will NOT continue." COM_MOKOJOOMBACKUP_RUNBACKUP_CANCELLING="Cancelling…" +COM_MOKOJOOMBACKUP_RUNBACKUP_FAILED_NO_UPDATE="Backup failed — the update was not started. Retry the backup, or go back without updating." COM_MOKOJOOMBACKUP_RUNBACKUP_CONTINUE_UPDATE="Continue the update" COM_MOKOJOOMBACKUP_CONFIG_CLEANUP="Cleanup Defaults" diff --git a/source/packages/com_mokosuitebackup/tmpl/runbackup/default.php b/source/packages/com_mokosuitebackup/tmpl/runbackup/default.php index 683f2e77..7fb1e458 100644 --- a/source/packages/com_mokosuitebackup/tmpl/runbackup/default.php +++ b/source/packages/com_mokosuitebackup/tmpl/runbackup/default.php @@ -90,6 +90,7 @@ $config = [ 'cancelConfirm1' => Text::_('COM_MOKOJOOMBACKUP_RUNBACKUP_CANCEL_CONFIRM1'), 'cancelConfirm2' => Text::_('COM_MOKOJOOMBACKUP_RUNBACKUP_CANCEL_CONFIRM2'), 'cancelling' => Text::_('COM_MOKOJOOMBACKUP_RUNBACKUP_CANCELLING'), + 'failedNoUpdate' => Text::_('COM_MOKOJOOMBACKUP_RUNBACKUP_FAILED_NO_UPDATE'), ], ]; @@ -304,7 +305,10 @@ $this->getDocument()->addStyleSheet(Uri::root(true) . '/media/com_mokosuitebacku el.bar.classList.add('is-danger'); if (el.warn) { el.warn.classList.add('d-none'); } el.title.textContent = L.failed || 'Backup failed'; - setStatus(message || 'Backup failed'); + /* Pre-update/uninstall flow: the backup failed, so the update must NOT + run. We deliberately do NOT offer a "continue without backup" option + here — the only ways forward are to retry the backup or go back. */ + setStatus(CFG.returnUrl ? (L.failedNoUpdate || 'Backup failed — the update was not started. Retry the backup, or go back without updating.') : (message || 'Backup failed')); hideCancel(); showActions(); @@ -312,15 +316,11 @@ $this->getDocument()->addStyleSheet(Uri::root(true) . '/media/com_mokosuitebacku el.retry.classList.remove('d-none'); el.retry.onclick = function () { el.retry.classList.add('d-none'); - el.continue.classList.add('d-none'); el.bar.classList.remove('is-danger'); el.bar.classList.add('is-animated'); run(); }; - if (CFG.returnUrl) { - showBtn(el.continue, L.continue || 'Continue without backup', CFG.returnUrl); - } showBtn(el.dashboard, L.dashboard || 'Back to dashboard', CFG.dashboardUrl); }