diff --git a/.mokogitea/workflows/issue-branch.yml b/.mokogitea/workflows/issue-branch.yml index 4662a2a..4fad36e 100644 --- a/.mokogitea/workflows/issue-branch.yml +++ b/.mokogitea/workflows/issue-branch.yml @@ -5,7 +5,7 @@ # FILE INFORMATION # DEFGROUP: Gitea.Workflow # INGROUP: mokocli.Automation -# VERSION: 01.00.36 +# VERSION: 01.00.37 # BRIEF: Auto-create feature branch when an issue is opened name: "Universal: Issue Branch" diff --git a/CHANGELOG.md b/CHANGELOG.md index eeabb81..a78983c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ ## [Unreleased] +### Fixed +- **Honest install success** — the package installer no longer shows the license / next-steps message when a bundled child extension failed to install. A fail-open manifest verifier confirms every child extension landed in `#__extensions` and reports any that are missing. + ### Added - **Package Manifest** — `pkg_mokosuiterealty.xml` with dlid and updateservers - **Plugin Manifest** — `mokosuiterealty.xml` with config fieldsets (listing defaults, search settings) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 21d7051..a07fd97 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -14,7 +14,7 @@ DEFGROUP: Template-Joomla INGROUP: Template-Joomla.Documentation REPO: https://github.com/mokoconsulting-tech/Template-Joomla/ - VERSION: 01.00.36 + VERSION: 01.00.37 PATH: ./CODE_OF_CONDUCT.md BRIEF: Community expectations and enforcement guidelines NOTE: Adapted with attribution from the Contributor Covenant v2.1 diff --git a/GOVERNANCE.md b/GOVERNANCE.md index 0bee2b3..bf91bd9 100644 --- a/GOVERNANCE.md +++ b/GOVERNANCE.md @@ -19,7 +19,7 @@ DEFGROUP: mokoconsulting-tech.Template-Joomla INGROUP: MokoStandards.Governance REPO: https://github.com/mokoconsulting-tech/Template-Joomla - VERSION: 01.00.36 + VERSION: 01.00.37 PATH: /GOVERNANCE.md BRIEF: Project governance rules, roles, and decision process for Template-Joomla --> diff --git a/SECURITY.md b/SECURITY.md index 3985bce..de65260 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -23,7 +23,7 @@ DEFGROUP: Template-Joomla INGROUP: Template-Joomla.Documentation REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Joomla PATH: /SECURITY.md -VERSION: 01.00.36 +VERSION: 01.00.37 BRIEF: Security vulnerability reporting and handling policy --> diff --git a/source/packages/com_mokosuiterealty/mokosuiterealty.xml b/source/packages/com_mokosuiterealty/mokosuiterealty.xml index 19c6c77..6c74987 100644 --- a/source/packages/com_mokosuiterealty/mokosuiterealty.xml +++ b/source/packages/com_mokosuiterealty/mokosuiterealty.xml @@ -5,7 +5,7 @@ 2026-06-23 Copyright (C) 2026 Moko Consulting. GPL-3.0-or-later - 01.00.36 + 01.00.37 Moko\Component\MokoSuiteRealty servicessrctmpl diff --git a/source/packages/plg_system_mokosuiterealty/mokosuiterealty.xml b/source/packages/plg_system_mokosuiterealty/mokosuiterealty.xml index b9b841e..b7a0f85 100644 --- a/source/packages/plg_system_mokosuiterealty/mokosuiterealty.xml +++ b/source/packages/plg_system_mokosuiterealty/mokosuiterealty.xml @@ -8,7 +8,7 @@ GPL-3.0-or-later hello@mokoconsulting.tech https://mokoconsulting.tech - 01.00.36 + 01.00.37 8.3 PLG_SYSTEM_MOKOSUITEREALTY_DESC Moko\Plugin\System\MokoSuiteRealty diff --git a/source/packages/plg_webservices_mokosuiterealty/mokosuiterealty.xml b/source/packages/plg_webservices_mokosuiterealty/mokosuiterealty.xml index 6bf398c..1ac8983 100644 --- a/source/packages/plg_webservices_mokosuiterealty/mokosuiterealty.xml +++ b/source/packages/plg_webservices_mokosuiterealty/mokosuiterealty.xml @@ -3,7 +3,7 @@ Web Services - MokoSuite Realty mokosuiterealty Moko Consulting - 01.00.36 + 01.00.37 GPL-3.0-or-later Moko\Plugin\WebServices\MokoSuiteRealty srcservices diff --git a/source/pkg_mokosuiterealty.xml b/source/pkg_mokosuiterealty.xml index 7cecec4..b675ef3 100644 --- a/source/pkg_mokosuiterealty.xml +++ b/source/pkg_mokosuiterealty.xml @@ -2,7 +2,7 @@ Package - MokoSuite Realty mokosuiterealty - 01.00.36 + 01.00.37 2026-06-21 Moko Consulting hello@mokoconsulting.tech diff --git a/source/script.php b/source/script.php index 267cb11..38a6923 100644 --- a/source/script.php +++ b/source/script.php @@ -19,9 +19,104 @@ class Pkg_MokoSuiteRealtyInstallerScript { public function postflight(string $type, InstallerAdapter $adapter): void { + // 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($adapter); + + if (!empty($missing)) + { + Factory::getApplication()->enqueueMessage( + '

MokoSuiteRealty did not install correctly.

' + . '

The following bundled extensions are missing: ' + . htmlspecialchars(implode(', ', $missing), ENT_QUOTES) . '

' + . '

Please uninstall MokoSuiteRealty and reinstall the full package.

', + 'error' + ); + + return; + } + $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 = "type"; element = + * "id" (for plugins, strip a leading plg__); plugins also match + * folder = "group". + * + * FAILS OPEN: any error returns [] so a transient glitch never fakes a failure. + */ + private function missingChildExtensions($adapter): array + { + try + { + $manifest = $adapter->getParent()->getManifest(); + + if (!$manifest || !isset($manifest->files) || !isset($manifest->files->file)) + { + return []; + } + + $db = Factory::getDbo(); + $missing = []; + + foreach ($manifest->files->file as $file) + { + $attrs = $file->attributes(); + $id = isset($attrs['id']) ? (string) $attrs['id'] : ''; + $exType = isset($attrs['type']) ? (string) $attrs['type'] : ''; + + if ($id === '' || $exType === '') + { + continue; + } + + $group = isset($attrs['group']) ? (string) $attrs['group'] : ''; + $element = $id; + + // Plugin element in #__extensions is the id minus any leading plg__. + if ($exType === 'plugin' && $group !== '') + { + $prefix = 'plg_' . $group . '_'; + + if (strpos($element, $prefix) === 0) + { + $element = substr($element, \strlen($prefix)); + } + } + + $query = $db->getQuery(true) + ->select('COUNT(*)') + ->from($db->quoteName('#__extensions')) + ->where($db->quoteName('element') . ' = ' . $db->quote($element)) + ->where($db->quoteName('type') . ' = ' . $db->quote($exType)); + + if ($exType === 'plugin' && $group !== '') + { + $query->where($db->quoteName('folder') . ' = ' . $db->quote($group)); + } + + if ((int) $db->setQuery($query)->loadResult() === 0) + { + $label = trim((string) $file); + $missing[] = $label !== '' ? preg_replace('/\.zip$/i', '', $label) : $id; + } + } + + return $missing; + } + catch (\Throwable $e) + { + // Fail open — never fake a failure on a glitch. + return []; + } + } + private function warnMissingLicenseKey(): void { try