feat: pre-update modal phase 2 — auto-run backup on Update click (#196) #233

Merged
jmiller merged 1 commits from feat/preupdate-auto-intercept into dev 2026-07-06 02:14:17 +00:00
Owner

Phase 2 of the pre-update backup modal (the "interception later" half of the plan), built on the #232 baseline.

What it adds

New opt-in component param preupdate_auto_intercept (radio, default 0/off, shown only when backup_before_update is on). When enabled, the update-page script (already injected by the phase-1 baseline) wraps window.Joomla.submitbutton: clicking the toolbar Update button first pops the backup progress modal, runs the pre-update backup, and — on success — re-issues the original update task so Joomla proceeds automatically.

Why Joomla.submitbutton

It's the one seam nearly every admin toolbar action routes through (Extensions → Update's "Update" = Joomla.submitbutton('update.update')), so a single wrap covers the update pages without hunting page-specific button IDs. submitbutton is synchronous, so the wrapper swallows the update task, runs the async backup, and calls the original submitbutton(task) itself once the backup resolves.

Safety

  • Matches only update.update / update.installnot update.find / update.purge (Find Updates / Clear Cache), which also start with "update".
  • Reuses the phase-1 overlay + ajax.preupdateAck, so the subsequent server-side onExtensionBeforeUpdate backup is throttled/skipped (no duplicate backup).
  • Off by default; the manual Back up now notice remains the always-on fallback for any flow that doesn't go through submitbutton (e.g. some com_joomlaupdate install paths).

Verify

  • php -l clean (plugin); node --check clean (JS); config.xml well-formed.
  • New param + en-US/en-GB language keys added.

This supersedes the stale interception attempt in the old PR #196 (which was based on 02.52.19 and used a 199-line inline JS blob). Recommend closing #196 once this lands.

Refs #196

https://claude.ai/code/session_01WbGBN9VyRK61zczYWcCQ2i

Phase 2 of the pre-update backup modal (the "interception later" half of the plan), built on the #232 baseline. ## What it adds New **opt-in** component param **`preupdate_auto_intercept`** (radio, default **0/off**, shown only when `backup_before_update` is on). When enabled, the update-page script (already injected by the phase-1 baseline) wraps **`window.Joomla.submitbutton`**: clicking the toolbar **Update** button first pops the backup progress modal, runs the pre-update backup, and — on success — re-issues the original update task so Joomla proceeds automatically. ## Why `Joomla.submitbutton` It's the one seam nearly every admin toolbar action routes through (Extensions → Update's "Update" = `Joomla.submitbutton('update.update')`), so a single wrap covers the update pages without hunting page-specific button IDs. `submitbutton` is synchronous, so the wrapper swallows the update task, runs the async backup, and calls the original `submitbutton(task)` itself once the backup resolves. ## Safety - Matches **only** `update.update` / `update.install` — **not** `update.find` / `update.purge` (Find Updates / Clear Cache), which also start with "update". - Reuses the phase-1 overlay + `ajax.preupdateAck`, so the subsequent server-side `onExtensionBeforeUpdate` backup is throttled/skipped (no duplicate backup). - Off by default; the manual **Back up now** notice remains the always-on fallback for any flow that doesn't go through `submitbutton` (e.g. some `com_joomlaupdate` install paths). ## Verify - `php -l` clean (plugin); `node --check` clean (JS); `config.xml` well-formed. - New param + en-US/en-GB language keys added. This supersedes the stale interception attempt in the old PR #196 (which was based on `02.52.19` and used a 199-line inline JS blob). Recommend closing #196 once this lands. Refs #196 https://claude.ai/code/session_01WbGBN9VyRK61zczYWcCQ2i
jmiller added 1 commit 2026-07-06 02:14:09 +00:00
feat: pre-update modal phase 2 — auto-run backup on Update click (#196)
Universal: PR Check / Branch Policy (pull_request) Successful in 1s
Universal: PR Check / Require Docs Update (pull_request) Has been skipped
Universal: PR Check / Wiki Update Reminder (pull_request) Has been skipped
Universal: PR Check / Secret Scan (pull_request) Successful in 4s
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Generic: Project CI / Lint & Validate (pull_request) Successful in 9s
Branch Cleanup / Delete merged branch (pull_request) Successful in 1s
Universal: PR Check / Validate PR (pull_request) Failing after 7s
Joomla: Metadata Validation / Validate Joomla Metadata (pull_request) Successful in 31s
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
c0ecf6ce73
Opt-in param preupdate_auto_intercept (off by default). When enabled the
injected update-page script wraps window.Joomla.submitbutton so clicking
the toolbar Update button first pops the progress modal, runs the
pre-update backup, and re-issues the original update task on success.

- Matches only update.update / update.install (not Find Updates /
  Clear Cache, which also start with 'update').
- Reuses the phase-1 overlay + ajax.preupdateAck throttle so the
  subsequent server-side onExtensionBeforeUpdate backup is skipped.
- The manual 'Back up now' notice remains a fallback for flows that
  don't route through submitbutton (e.g. some com_joomlaupdate paths).

Refs #196

Claude-Session: https://claude.ai/code/session_01WbGBN9VyRK61zczYWcCQ2i
jmiller merged commit 7165da4999 into dev 2026-07-06 02:14:17 +00:00
jmiller deleted branch feat/preupdate-auto-intercept 2026-07-06 02:14:17 +00:00
Sign in to join this conversation.