fix(installer): gate install-success on real verification #120
Reference in New Issue
Block a user
Delete Branch "fix/installer-success-detection"
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?
Problem
Joomla installers are lenient: a failed sub-step is logged but
postflightstill runs, so any "installed successfully" / next-steps message can lie.Changes
Package script (
source/script.php)missingChildExtensions(): reads the package manifest via$parent->getParent()->getManifest(), iterates<files><file>and verifies each declared child is registered in#__extensions(matchelement+type, plusfolderfor plugins).postflight()now gates the success path: if any children are missing it enqueues an error listing them and returns before the licence notice. Download-key restore and the plugin-enable loop still run as housekeeping.Component script (
source/packages/com_mokoog/script.php)missingTables(): parses the installed SQL atJPATH_ADMINISTRATOR/components/com_mokoog/sql/install.mysql.sqlforCREATE TABLEdeclarations and verifies each exists (prefix-substituted, case-insensitive). The component declares one table (#__mokoog_tags), so this check applies.install()now runs the check and enqueues an error instead of echoing success when tables are missing.Both checks fail open (any error / unreadable manifest or SQL returns "nothing missing") so a good install is never falsely flagged. Lists are derived dynamically; interpolated names are
htmlspecialchars()-escaped. Mirrors the reference implementation in MokoSuiteCommunitydev.php -lpasses on both files.