feat: pre-update backup notice + live-progress modal on update pages (#196) #232

Merged
jmiller merged 1 commits from feat/preupdate-modal-notice into dev 2026-07-06 01:57:41 +00:00
Owner

Phase-1 baseline for the pre-update backup modal ("notice now, interception later").

Why nothing "popped"

The server-side onExtensionBeforeUpdate backup runs synchronously mid-request, so it can't drive a browser modal — the HTTP response isn't flushed until the whole update finishes. A live modal has to live on the client, on the update page.

What this adds

  • plg_system_mokosuitebackup gains onBeforeCompileHead — on com_joomlaupdate and com_installer&view=update, gated by the existing show_update_notice + backup_before_update params (and skipped if a pre-update backup already ran this session), it injects:
    • a "back up before you update" notice with a Back up now button, and
    • a new media JS asset that runs the same stepped backup as the dashboard (ajax.init → loop ajax.step until done) with a dependency-free progress overlay.
  • AjaxController::preupdateAck() (new endpoint) — after a successful modal backup the client pings it; it arms the same 10-minute throttle key runPreActionBackup() checks, so clicking Joomla's Update afterward won't run a duplicate server-side backup.
  • Plugin manifest registers the new media/js folder; en-US/en-GB language keys added.

Design notes

  • On-demand (button) rather than auto-intercepting the Update button — robust, no fragile wrapping of Joomla's own updater JS. Config is passed via Joomla.getOptions('plg_system_mokosuitebackup.preupdate').
  • Phase 2 (later): auto-intercept the Update button so it backs up then continues automatically. The open PR #196 is that approach and should be rebased on top of this baseline so there aren't two competing modals.

Verify

  • php -l clean (AjaxController, plugin); node --check clean (JS).
  • Gating confirmed against config.xml params show_update_notice, backup_before_update, default_profile.

Refs #196

https://claude.ai/code/session_01WbGBN9VyRK61zczYWcCQ2i

Phase-1 baseline for the pre-update backup modal ("notice now, interception later"). ## Why nothing "popped" The server-side `onExtensionBeforeUpdate` backup runs **synchronously mid-request**, so it can't drive a browser modal — the HTTP response isn't flushed until the whole update finishes. A live modal has to live on the client, on the update page. ## What this adds - **`plg_system_mokosuitebackup` gains `onBeforeCompileHead`** — on `com_joomlaupdate` and `com_installer&view=update`, gated by the existing `show_update_notice` + `backup_before_update` params (and skipped if a pre-update backup already ran this session), it injects: - a "back up before you update" **notice** with a **Back up now** button, and - a new **media JS asset** that runs the *same* stepped backup as the dashboard (`ajax.init` → loop `ajax.step` until `done`) with a **dependency-free progress overlay**. - **`AjaxController::preupdateAck()`** (new endpoint) — after a successful modal backup the client pings it; it arms the same 10-minute throttle key `runPreActionBackup()` checks, so clicking Joomla's Update afterward **won't run a duplicate** server-side backup. - Plugin manifest registers the new `media/js` folder; en-US/en-GB language keys added. ## Design notes - On-demand (button) rather than auto-intercepting the Update button — robust, no fragile wrapping of Joomla's own updater JS. Config is passed via `Joomla.getOptions('plg_system_mokosuitebackup.preupdate')`. - **Phase 2 (later):** auto-intercept the Update button so it backs up then continues automatically. The open PR #196 is that approach and should be rebased on top of this baseline so there aren't two competing modals. ## Verify - `php -l` clean (AjaxController, plugin); `node --check` clean (JS). - Gating confirmed against `config.xml` params `show_update_notice`, `backup_before_update`, `default_profile`. Refs #196 https://claude.ai/code/session_01WbGBN9VyRK61zczYWcCQ2i
jmiller added 1 commit 2026-07-06 01:57:29 +00:00
feat: pre-update backup notice + live-progress modal on update pages
Universal: PR Check / Wiki Update Reminder (pull_request) Has been skipped
Universal: PR Check / Branch Policy (pull_request) Successful in 2s
Universal: PR Check / Require Docs Update (pull_request) Has been skipped
Universal: PR Check / Secret Scan (pull_request) Successful in 10s
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Successful in 1s
Generic: Project CI / Lint & Validate (pull_request) Successful in 15s
Universal: PR Check / Validate PR (pull_request) Failing after 12s
Joomla: Metadata Validation / Validate Joomla Metadata (pull_request) Successful in 48s
Generic: Project CI / Tests (pull_request) Has been cancelled
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
8dc4eaa384
The server-side onExtensionBeforeUpdate backup runs synchronously and
cannot drive a browser modal, so nothing ever 'popped'. Add a client
notice + on-demand live-progress modal on com_joomlaupdate and
com_installer(view=update):

- plg_system_mokosuitebackup gains onBeforeCompileHead, which injects a
  'back up before you update' notice + Back up now button on the update
  pages (gated by show_update_notice + backup_before_update), plus a new
  media JS asset that runs the same stepped backup as the dashboard
  (ajax.init then a loop of ajax.step) with a dependency-free progress
  overlay.
- New AjaxController::preupdateAck() arms the same 10-min throttle key
  runPreActionBackup() checks, so proceeding with Joomla's update after a
  modal backup does not run a duplicate server-side backup.
- Plugin manifest registers the new media/js folder; language keys added.

Phase-1 baseline (notice + on-demand). Auto-intercepting the Update
button is the planned phase-2 follow-up (#196).

Refs #196

Claude-Session: https://claude.ai/code/session_01WbGBN9VyRK61zczYWcCQ2i
jmiller merged commit da71057079 into dev 2026-07-06 01:57:41 +00:00
jmiller deleted branch feat/preupdate-modal-notice 2026-07-06 01:57:42 +00:00
Sign in to join this conversation.