fix(installer): self-heal orphaned com_component-mokosuitebackup on update #216

Merged
jmiller merged 2 commits from fix/orphan-component-cleanup into main 2026-07-05 22:23:09 +00:00
Owner

Follow-up to #213. The manifest fix stops new duplicate registrations; this reconciles already-affected sites (like suite.dev) automatically on the next update — no manual DB surgery, no SSH.

What it does

Pkg_MokoSuiteBackupInstallerScript::postflight() now calls removeOrphanedComponent(), which finds any component whose element matches %component%mokosuitebackup% (explicitly excluding com_mokosuitebackup) and removes:

  • its #__menu admin menu items,
  • its #__schemas rows,
  • its #__update_sites_extensions mapping,
  • the #__extensions record itself,
  • the stray administrator/components/com_component-mokosuitebackup/ folder (native recursive delete — no Joomla Folder namespace dependency).

Idempotent (no-op when clean) and wrapped in try/catch so it can never block an install/update. Runs on install + update. php -l clean.

Result for suite.dev

After the corrected package (≥ this build) is installed, the real com_mokosuitebackup (id 951) updates to current and the bogus com_component-mokosuitebackup (id 1218) + its folder/menu/schema rows are removed — the admin then loads the current component (working remote-destinations tab, no legacy dropdowns).

Note: the changelog [Unreleased] entry here will lightly overlap #215 (changelog backfill) — trivial rebase if that merges first.

https://claude.ai/code/session_01WbGBN9VyRK61zczYWcCQ2i

Follow-up to #213. The manifest fix stops *new* duplicate registrations; this **reconciles already-affected sites** (like suite.dev) automatically on the next update — no manual DB surgery, no SSH. ## What it does `Pkg_MokoSuiteBackupInstallerScript::postflight()` now calls `removeOrphanedComponent()`, which finds any component whose `element` matches `%component%mokosuitebackup%` (explicitly excluding `com_mokosuitebackup`) and removes: - its `#__menu` admin menu items, - its `#__schemas` rows, - its `#__update_sites_extensions` mapping, - the `#__extensions` record itself, - the stray `administrator/components/com_component-mokosuitebackup/` folder (native recursive delete — no Joomla `Folder` namespace dependency). Idempotent (no-op when clean) and wrapped in try/catch so it can never block an install/update. Runs on install + update. `php -l` clean. ## Result for suite.dev After the corrected package (≥ this build) is installed, the real `com_mokosuitebackup` (id 951) updates to current **and** the bogus `com_component-mokosuitebackup` (id 1218) + its folder/menu/schema rows are removed — the admin then loads the current component (working remote-destinations tab, no legacy dropdowns). Note: the changelog `[Unreleased]` entry here will lightly overlap #215 (changelog backfill) — trivial rebase if that merges first. https://claude.ai/code/session_01WbGBN9VyRK61zczYWcCQ2i
jmiller added 1 commit 2026-07-05 22:12:11 +00:00
fix(installer): self-heal orphaned com_component-mokosuitebackup on update
Joomla: Extension CI / Release Readiness Check (pull_request) Failing after 7s
Generic: Project CI / Lint & Validate (pull_request) Successful in 16s
Universal: PR Check / Branch Policy (pull_request) Successful in 2s
Universal: PR Check / Wiki Update Reminder (pull_request) Successful in 3s
Universal: PR Check / Require Docs Update (pull_request) Failing after 7s
Universal: PR Check / Secret Scan (pull_request) Successful in 9s
Universal: PR Check / Validate PR (pull_request) Failing after 13s
Generic: Repo Health / Access control (pull_request) Successful in 2s
Generic: Repo Health / Site Health (pull_request) Has been skipped
Joomla: Extension CI / Lint & Validate (pull_request) Failing after 52s
Joomla: Metadata Validation / Validate Joomla Metadata (pull_request) Successful in 50s
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 29s
Universal: Build & Release / Promote to RC (pull_request) Failing after 15s
Universal: Build & Release / Build & Release Pipeline (pull_request) Has been skipped
Generic: Project CI / Tests (pull_request) Has been cancelled
Joomla: Extension CI / Tests (PHP 8.2) (pull_request) Has been cancelled
Joomla: Extension CI / Tests (PHP 8.3) (pull_request) Has been cancelled
Joomla: Extension CI / PHPStan Analysis (pull_request) Has been cancelled
Joomla: Extension CI / Build RC Pre-Release (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
Generic: Repo Health / Scripts governance (pull_request) Has been cancelled
Generic: Repo Health / Repository health (pull_request) Has been cancelled
Generic: Repo Health / Report: Scripts Governance (pull_request) Has been cancelled
Generic: Repo Health / Report: Repository Health (pull_request) Has been cancelled
1029e40908
The old "Type - Name" component <name> made Joomla register a duplicate
component under element com_component-mokosuitebackup (its own extension row,
admin menu, schema rows and administrator/ folder), orphaning the real
com_mokosuitebackup on the old version. The manifest fix (#213) prevents new
occurrences; this reconciles already-affected sites automatically.

Package postflight now removes any component whose element matches
%component%mokosuitebackup% (excluding com_mokosuitebackup): deletes its
#__menu, #__schemas and #__update_sites_extensions rows, the #__extensions
record, and the stray admin folder. Idempotent and non-fatal.

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

Wiki reminder: docs are wiki-first -- if this PR changes behavior, usage, config, or standards, please update the repo wiki before/after merge. (non-blocking)

<!-- wiki-reminder --> **Wiki reminder:** docs are wiki-first -- if this PR changes behavior, usage, config, or standards, please update the repo wiki before/after merge. _(non-blocking)_
jmiller added 1 commit 2026-07-05 22:14:25 +00:00
chore(version): pre-release bump to 02.56.11-dev [skip ci]
Universal: Build & Release / Promote to RC (pull_request) Has been skipped
Universal: Workflow Sync Trigger / Sync workflows to live repos (pull_request) Has been skipped
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Successful in 2s
Universal: Build & Release / Build & Release Pipeline (pull_request) Successful in 31s
39d94a31d6
jmiller merged commit 2688ea352b into main 2026-07-05 22:23:09 +00:00
jmiller deleted branch fix/orphan-component-cleanup 2026-07-05 22:23:09 +00:00
Sign in to join this conversation.