fix: installer postflight is honest about a partial/failed install #239
Reference in New Issue
Block a user
Delete Branch "fix/installer-honesty"
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?
The package postflight could print "MokoSuiteBackup installed successfully!" + next-steps even when the install actually failed or only partially completed — because Joomla logs a failed child extension but still runs the package postflight.
Fix (package installer —
source/script.php,type="package")Before the success/next-steps messages, the postflight now gates on two dynamically-derived checks:
$parent->getParent()->getManifest(), iterate<files><file>, and confirm each declared child exists in#__extensions, matched byelement(= fileid) +type, and for plugins alsofolder(= filegroup) since plugins are only unique that way.CREATE TABLEs failed (exactly the class of bug the MySQL-8 PREPARE migration caused). Parse the installedadministrator/components/com_mokosuitebackup/sql/install.mysql.sqlwithpreg_match_all('/CREATE\s+TABLE\s+(?:IF\s+NOT\s+EXISTS\s+)?[\"']?(#[A-Za-z0-9_]+)/i', …), swap#for$db->getPrefix(), and verify each is in$db->getTableList()` (case-insensitive).If anything is missing → enqueue an error listing it and RETURN before the success message.
Safety
htmlspecialchars.Verify
php -lclean.https://claude.ai/code/session_01WbGBN9VyRK61zczYWcCQ2i