fix(installer): self-heal orphaned com_component-mokosuitebackup on update #216
Reference in New Issue
Block a user
Delete Branch "fix/orphan-component-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 callsremoveOrphanedComponent(), which finds any component whoseelementmatches%component%mokosuitebackup%(explicitly excludingcom_mokosuitebackup) and removes:#__menuadmin menu items,#__schemasrows,#__update_sites_extensionsmapping,#__extensionsrecord itself,administrator/components/com_component-mokosuitebackup/folder (native recursive delete — no JoomlaFoldernamespace dependency).Idempotent (no-op when clean) and wrapped in try/catch so it can never block an install/update. Runs on install + update.
php -lclean.Result for suite.dev
After the corrected package (≥ this build) is installed, the real
com_mokosuitebackup(id 951) updates to current and the boguscom_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
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)