fix(installer): self-heal admin menu + alias collision + short-constant label #219
Reference in New Issue
Block a user
Delete Branch "fix/admin-menu-selfheal"
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?
Targeting dev for the next dev build (stacks on the SQL-install fix).
Cleans up the admin-menu fallout of the duplicate-component element bug — the cascade you saw: alias collision → install aborts → "Backup" menu deleted → gone from the admin menu → cPanel module + MokoSuiteClient can't find it.
Changes
removeOrphanedComponent()now also runs in preflight, before the component recreates its menu. The orphan (com_component-mokosuitebackup) owns a "Backup" menu with aliasbackup; removing it first stops the collision (The alias backup is already being used by the Backup menu item).ensureSubmenuItems()used toreturnwhen the parent "Backup" menu was missing (so a deleted menu never came back). It now recreates the top-level menu via newcreateTopMenu(), then rebuilds the submenus. Backup reappears in the admin menu → cPanel module + MokoSuiteClient detection recover.COM_MOKOJOOMBACKUP_SHORT(in the manifest<menu>and normalized in the script), so it reads "Backup" via the short constant, not a full/hardcoded value. Constant is defined in.iniand.sys.ini.php -lclean, manifest XML valid.Note
MokoSuiteClient "not recognizing" the component and the cPanel module's missing item are downstream of the broken registration/menu — they should recover once a clean build reinstalls with a valid
com_mokosuitebackupregistration + menu. If MokoSuiteClient still can't see it after this, its detection logic may need a separate look (it may key off something other than the menu/#__extensions).https://claude.ai/code/session_01WbGBN9VyRK61zczYWcCQ2i
Fallout of the duplicate-component element bug: - Preflight now runs removeOrphanedComponent() BEFORE the component install recreates its menu, so the orphan's "Backup" menu (alias "backup") no longer collides ("The alias backup is already being used by the Backup menu item"). - ensureSubmenuItems() recreates the top-level "Backup" menu when it is missing (via new createTopMenu()) instead of bailing out — so a failed install that deleted the parent menu no longer leaves Backup gone from the admin menu (which also broke the cPanel module and MokoSuiteClient component detection). - The top-level menu label now uses the short constant COM_MOKOJOOMBACKUP_SHORT (manifest <menu> + enforced/normalized in the script). Claude-Session: https://claude.ai/code/session_01WbGBN9VyRK61zczYWcCQ2i