fix: show progress modal for pre-extension-update backup #196

Closed
jmiller wants to merge 2 commits from fix/preupdate-backup-popup into main
Owner

Summary

  • The pre-update backup ran synchronously in onExtensionBeforeUpdate with no browser feedback — the page just hung until backup + update finished
  • System plugin now injects JavaScript on com_installer and com_joomlaupdate pages that intercepts the update button, shows a Bootstrap 5 modal with a progress bar, and runs the backup via the stepped AJAX API (ajax.init + ajax.step)
  • On completion it proceeds with the original update; on failure it shows Skip & Cancel buttons
  • Server-side onExtensionBeforeUpdate remains as a fallback for CLI/API updates, with a session flag to prevent double-running when JS already handled it

Test plan

  • Navigate to Extensions > Manage > Update, select an extension, click Update — modal should appear with progress bar
  • Verify backup completes and update proceeds automatically
  • Test backup failure scenario — Skip and Cancel buttons should appear
  • Verify Joomla Update page also shows the modal
  • Confirm CLI updates still run the server-side backup fallback

https://claude.ai/code/session_01MbEjBtsSjPuTWhqqrMS2wG

## Summary - The pre-update backup ran synchronously in `onExtensionBeforeUpdate` with no browser feedback — the page just hung until backup + update finished - System plugin now injects JavaScript on `com_installer` and `com_joomlaupdate` pages that intercepts the update button, shows a Bootstrap 5 modal with a progress bar, and runs the backup via the stepped AJAX API (`ajax.init` + `ajax.step`) - On completion it proceeds with the original update; on failure it shows Skip & Cancel buttons - Server-side `onExtensionBeforeUpdate` remains as a fallback for CLI/API updates, with a session flag to prevent double-running when JS already handled it ## Test plan - [ ] Navigate to Extensions > Manage > Update, select an extension, click Update — modal should appear with progress bar - [ ] Verify backup completes and update proceeds automatically - [ ] Test backup failure scenario — Skip and Cancel buttons should appear - [ ] Verify Joomla Update page also shows the modal - [ ] Confirm CLI updates still run the server-side backup fallback https://claude.ai/code/session_01MbEjBtsSjPuTWhqqrMS2wG
jmiller added 2 commits 2026-06-30 18:28:53 +00:00
fix: show progress modal for pre-extension-update backup
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 18s
430b25cea5
The pre-update backup ran synchronously in onExtensionBeforeUpdate with
no browser feedback — the page just hung until backup + update finished.

Now the system plugin injects JavaScript on com_installer and
com_joomlaupdate pages that intercepts the update button, shows a
Bootstrap modal with a progress bar, and runs the backup via the
stepped AJAX API (ajax.init + ajax.step). On completion it proceeds
with the original update. On failure it shows Skip & Cancel buttons.

The server-side handler remains as a fallback for CLI/API updates.
A session flag prevents double-running when JS already handled it.

Claude-Session: https://claude.ai/code/session_01MbEjBtsSjPuTWhqqrMS2wG
Author
Owner

Phase-1 baseline landed on dev in #232 (build 02.58.08-dev): a pre-update backup notice + on-demand live-progress modal on the Joomla Update and Extensions→Update pages.

  • plg_system_mokosuitebackup::onBeforeCompileHead injects a "back up before you update" notice + Back up now button (gated by show_update_notice + backup_before_update, skipped if a pre-update backup already ran this session).
  • A new media JS asset runs the same stepped backup as the dashboard (ajax.init → loop ajax.step) with a dependency-free progress overlay.
  • New AjaxController::preupdateAck() arms the same throttle key runPreActionBackup() checks, so proceeding with Joomla's Update won't run a duplicate backup.

This PR (#196) is the phase-2 approach — auto-intercepting the Update button so it backs up then continues automatically. It should be rebased on top of the #232 baseline so the two don't ship competing modals (the baseline's notice/overlay + preupdateAck can be reused; #196 would add the button-wrapping + auto-continue on top). Leaving open as the tracked follow-up.

Phase-1 baseline landed on `dev` in #232 (build `02.58.08-dev`): a **pre-update backup notice + on-demand live-progress modal** on the Joomla Update and Extensions→Update pages. - `plg_system_mokosuitebackup::onBeforeCompileHead` injects a "back up before you update" notice + **Back up now** button (gated by `show_update_notice` + `backup_before_update`, skipped if a pre-update backup already ran this session). - A new media JS asset runs the same stepped backup as the dashboard (`ajax.init` → loop `ajax.step`) with a dependency-free progress overlay. - New `AjaxController::preupdateAck()` arms the same throttle key `runPreActionBackup()` checks, so proceeding with Joomla's Update won't run a duplicate backup. **This PR (#196) is the phase-2 approach** — auto-intercepting the Update button so it backs up then continues automatically. It should be rebased on top of the #232 baseline so the two don't ship competing modals (the baseline's notice/overlay + `preupdateAck` can be reused; #196 would add the button-wrapping + auto-continue on top). Leaving open as the tracked follow-up.
Author
Owner

Both phases are now on dev, superseding this PR:

  • Phase 1 (#232) — pre-update notice + on-demand live-progress modal + ajax.preupdateAck.
  • Phase 2 (#233) — opt-in preupdate_auto_intercept: wraps Joomla.submitbutton for update.update/update.install so clicking Update pops the modal, backs up, then continues automatically.

This PR's branch is stale (based on 02.52.19, a 199-line inline JS blob) and is fully replaced by the cleaner asset-based implementation. Closing.

Both phases are now on `dev`, superseding this PR: - **Phase 1** (#232) — pre-update notice + on-demand live-progress modal + `ajax.preupdateAck`. - **Phase 2** (#233) — opt-in `preupdate_auto_intercept`: wraps `Joomla.submitbutton` for `update.update`/`update.install` so clicking Update pops the modal, backs up, then continues automatically. This PR's branch is stale (based on `02.52.19`, a 199-line inline JS blob) and is fully replaced by the cleaner asset-based implementation. Closing.
jmiller closed this pull request 2026-07-06 02:14:55 +00:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.