fix(installer): gate install-success on real verification #120

Merged
jmiller merged 2 commits from fix/installer-success-detection into dev 2026-07-06 16:15:37 +00:00
Owner

Problem

Joomla installers are lenient: a failed sub-step is logged but postflight still runs, so any "installed successfully" / next-steps message can lie.

Changes

Package script (source/script.php)

  • Added missingChildExtensions(): reads the package manifest via $parent->getParent()->getManifest(), iterates <files><file> and verifies each declared child is registered in #__extensions (match element+type, plus folder for 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)

  • Added missingTables(): parses the installed SQL at JPATH_ADMINISTRATOR/components/com_mokoog/sql/install.mysql.sql for CREATE TABLE declarations 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 MokoSuiteCommunity dev.

php -l passes on both files.

## Problem Joomla installers are lenient: a failed sub-step is logged but `postflight` still runs, so any "installed successfully" / next-steps message can lie. ## Changes **Package script (`source/script.php`)** - Added `missingChildExtensions()`: reads the package manifest via `$parent->getParent()->getManifest()`, iterates `<files><file>` and verifies each declared child is registered in `#__extensions` (match `element`+`type`, plus `folder` for 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`)** - Added `missingTables()`: parses the installed SQL at `JPATH_ADMINISTRATOR/components/com_mokoog/sql/install.mysql.sql` for `CREATE TABLE` declarations 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 MokoSuiteCommunity `dev`. `php -l` passes on both files.
jmiller added 2 commits 2026-07-06 03:55:10 +00:00
fix(installer): gate install-success on real verification
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 22s
a6a24f72de
Joomla installers keep running after a failed sub-step, so a postflight
"installed successfully" / next-steps message can lie. Gate the success
path in both installer scripts.

Package (source/script.php): postflight now verifies every child extension
declared in the package manifest actually registered in #__extensions
(element + type, plus folder for plugins). If any are missing it enqueues
an error listing them and returns before the licence notice. Download-key
restore and plugin-enable housekeeping still run unconditionally. Check
fails open on any error.

Component (source/packages/com_mokoog/script.php): install() now parses the
installed SQL (JPATH_ADMINISTRATOR/components/com_mokoog/sql/install.mysql.sql)
for CREATE TABLE declarations and verifies each exists (prefix-substituted,
case-insensitive) before echoing the success message. Fails open if the SQL
is unreadable.

Claude-Session: https://claude.ai/code/session_01MrxXW9iyuDda5yDZrjZMbF
chore(version): pre-release bump to 01.07.05-dev [skip ci]
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Successful in 1s
a6fe8fb580
jmiller merged commit fe38a422be into dev 2026-07-06 16:15:37 +00:00
jmiller deleted branch fix/installer-success-detection 2026-07-06 16:15:37 +00:00
Sign in to join this conversation.