diff --git a/CHANGELOG.md b/CHANGELOG.md index 86a037a5..a82e7f04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog ## [Unreleased] +### Fixed +- **Honest installer success**: The package installer no longer shows the license / next-steps message when a bundled child extension failed to install. Postflight now verifies every component, module, and plugin declared in the package manifest actually landed in `#__extensions` and, if any are missing, enqueues an error listing them instead of the success message. The check fails open, so a transient query/IO glitch never turns a good install into a false failure; all housekeeping (download-key restore, plugin enabling, migration detection) still runs unconditionally. + ## [01.12.00] --- 2026-06-28 ## [01.12.00] --- 2026-06-28 diff --git a/source/script.php b/source/script.php index 7c4bfcbc..e1ef18df 100644 --- a/source/script.php +++ b/source/script.php @@ -40,8 +40,8 @@ class Pkg_MokoSuiteCrossInstallerScript public function postflight(string $type, InstallerAdapter $parent): void { + // Housekeeping — runs unconditionally regardless of child-install result. $this->restoreDownloadKey(); - $this->warnMissingLicenseKey(); $db = Factory::getDbo(); @@ -76,6 +76,108 @@ class Pkg_MokoSuiteCrossInstallerScript $this->detectPerfectPublisherPro($db); } + + // Be honest about success. Joomla's package installer only LOGS a failed child + // sub-install but still runs this postflight, so don't show the license / + // next-steps message if a bundled extension is actually missing. Fails open + // (see missingChildExtensions) so a query/IO glitch never fakes a failure. + $missing = $this->missingChildExtensions($parent); + + if (!empty($missing)) + { + Factory::getApplication()->enqueueMessage( + '
The following bundled extensions are missing: ' + . htmlspecialchars(implode(', ', $missing), ENT_QUOTES) . '
' + . 'Please uninstall MokoSuiteCross and reinstall the full package.
', + 'error' + ); + + return; + } + + // Warn if no license key is configured (success / next-steps path). + $this->warnMissingLicenseKey(); + } + + /** + * Verify every child extension declared in the package manifest actually landed + * in #__extensions. Returns readable labels of any that are missing. + * + * Matching per Joomla's #__extensions uniqueness: + * - type = the