9 Commits

Author SHA1 Message Date
gitea-actions[bot] 83bcbab59a chore(version): pre-release bump to 01.00.40-dev [skip ci] 2026-07-07 10:17:02 +00:00
jmiller a2ef8b1dce Merge pull request 'feat(menu): admin menu short-name constant COM_MOKOSUITEREALTY_SHORT (#13)' (#16) from fix/short-menu-constant into dev
Universal: Auto Version Bump / Version Bump (push) Has been skipped
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 10s
2026-07-07 10:15:37 +00:00
gitea-actions[bot] fef2ba59aa chore(version): pre-release bump to 01.00.39-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
2026-07-06 22:45:15 +00:00
gitea-actions[bot] f008296017 chore(version): pre-release bump to 01.00.38-dev [skip ci] 2026-07-06 22:44:56 +00:00
jmiller c0e5ff04aa feat(menu): use COM_MOKOSUITEREALTY_SHORT + wire admin language (#13)
Universal: PR Check / Branch Policy (pull_request) Successful in 2s
Universal: PR Check / Validate PR (pull_request) Failing after 9s
Universal: PR Check / Secret Scan (pull_request) Successful in 10s
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 17s
Joomla: Metadata Validation / Validate Joomla Metadata (pull_request) Successful in 53s
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
Claude-Session: https://claude.ai/code/session_01B9aZHSWbiiZykJD88pYx8R
2026-07-06 22:44:29 +00:00
jmiller d35375c7f1 feat(menu): add COM_MOKOSUITEREALTY_SHORT short-name constant (#13)
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 25s
Claude-Session: https://claude.ai/code/session_01B9aZHSWbiiZykJD88pYx8R
2026-07-06 22:44:12 +00:00
jmiller b43477a2fb Merge pull request 'fix: honest installer success' (#15) from fix/honest-install-success into dev
Universal: Auto Version Bump / Version Bump (push) Has been skipped
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Failing after 9s
2026-07-06 16:23:03 +00:00
gitea-actions[bot] e4e317f195 chore(version): pre-release bump to 01.00.37-dev [skip ci]
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Failing after 2s
2026-07-06 16:20:05 +00:00
jmiller f673e130dd fix: honest installer success (gate license/next-steps on child install)
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 11s
The package postflight showed the "License Key Required" / next-steps
message even when a bundled child extension failed to sub-install
(Joomla only logs those failures). Add a fail-open manifest verifier
(missingChildExtensions) that confirms every declared child landed in
#__extensions and enqueues an error + returns before the license path
when any are missing. Fails open so a transient glitch never fakes a
failure.

Claude-Session: https://claude.ai/code/session_01B9aZHSWbiiZykJD88pYx8R
2026-07-06 11:19:33 -05:00
11 changed files with 79 additions and 70 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
# FILE INFORMATION # FILE INFORMATION
# DEFGROUP: Gitea.Workflow # DEFGROUP: Gitea.Workflow
# INGROUP: mokocli.Automation # INGROUP: mokocli.Automation
# VERSION: 01.00.36 # VERSION: 01.00.40
# BRIEF: Auto-create feature branch when an issue is opened # BRIEF: Auto-create feature branch when an issue is opened
name: "Universal: Issue Branch" name: "Universal: Issue Branch"
+3
View File
@@ -9,6 +9,9 @@
## [Unreleased] ## [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 ### Added
- **Package Manifest** — `pkg_mokosuiterealty.xml` with dlid and updateservers - **Package Manifest** — `pkg_mokosuiterealty.xml` with dlid and updateservers
- **Plugin Manifest** — `mokosuiterealty.xml` with config fieldsets (listing defaults, search settings) - **Plugin Manifest** — `mokosuiterealty.xml` with config fieldsets (listing defaults, search settings)
+1 -1
View File
@@ -14,7 +14,7 @@
DEFGROUP: Template-Joomla DEFGROUP: Template-Joomla
INGROUP: Template-Joomla.Documentation INGROUP: Template-Joomla.Documentation
REPO: https://github.com/mokoconsulting-tech/Template-Joomla/ REPO: https://github.com/mokoconsulting-tech/Template-Joomla/
VERSION: 01.00.36 VERSION: 01.00.40
PATH: ./CODE_OF_CONDUCT.md PATH: ./CODE_OF_CONDUCT.md
BRIEF: Community expectations and enforcement guidelines BRIEF: Community expectations and enforcement guidelines
NOTE: Adapted with attribution from the Contributor Covenant v2.1 NOTE: Adapted with attribution from the Contributor Covenant v2.1
+1 -1
View File
@@ -19,7 +19,7 @@
DEFGROUP: mokoconsulting-tech.Template-Joomla DEFGROUP: mokoconsulting-tech.Template-Joomla
INGROUP: MokoStandards.Governance INGROUP: MokoStandards.Governance
REPO: https://github.com/mokoconsulting-tech/Template-Joomla REPO: https://github.com/mokoconsulting-tech/Template-Joomla
VERSION: 01.00.36 VERSION: 01.00.40
PATH: /GOVERNANCE.md PATH: /GOVERNANCE.md
BRIEF: Project governance rules, roles, and decision process for Template-Joomla BRIEF: Project governance rules, roles, and decision process for Template-Joomla
--> -->
+1 -1
View File
@@ -23,7 +23,7 @@ DEFGROUP: Template-Joomla
INGROUP: Template-Joomla.Documentation INGROUP: Template-Joomla.Documentation
REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Joomla REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Joomla
PATH: /SECURITY.md PATH: /SECURITY.md
VERSION: 01.00.36 VERSION: 01.00.40
BRIEF: Security vulnerability reporting and handling policy BRIEF: Security vulnerability reporting and handling policy
--> -->
@@ -0,0 +1,3 @@
COM_MOKOSUITEREALTY="MokoSuite Realty"
COM_MOKOSUITEREALTY_SHORT="Realty"
COM_MOKOSUITEREALTY_XML_DESCRIPTION="MokoSuite Realty component."
@@ -5,10 +5,13 @@
<creationDate>2026-06-23</creationDate> <creationDate>2026-06-23</creationDate>
<copyright>Copyright (C) 2026 Moko Consulting.</copyright> <copyright>Copyright (C) 2026 Moko Consulting.</copyright>
<license>GPL-3.0-or-later</license> <license>GPL-3.0-or-later</license>
<version>01.00.36</version> <version>01.00.40</version>
<namespace path="src">Moko\Component\MokoSuiteRealty</namespace> <namespace path="src">Moko\Component\MokoSuiteRealty</namespace>
<administration> <administration>
<files folder="admin"><folder>services</folder><folder>src</folder><folder>tmpl</folder></files> <files folder="admin"><folder>services</folder><folder>src</folder><folder>tmpl</folder></files>
<menu>COM_MOKOSUITEREALTY</menu> <menu>COM_MOKOSUITEREALTY_SHORT</menu>
<languages folder="admin/language">
<language tag="en-GB">en-GB/com_mokosuiterealty.sys.ini</language>
</languages>
</administration> </administration>
</extension> </extension>
@@ -8,7 +8,7 @@
<license>GPL-3.0-or-later</license> <license>GPL-3.0-or-later</license>
<authorEmail>hello@mokoconsulting.tech</authorEmail> <authorEmail>hello@mokoconsulting.tech</authorEmail>
<authorUrl>https://mokoconsulting.tech</authorUrl> <authorUrl>https://mokoconsulting.tech</authorUrl>
<version>01.00.36</version> <version>01.00.40</version>
<php_minimum>8.3</php_minimum> <php_minimum>8.3</php_minimum>
<description>PLG_SYSTEM_MOKOSUITEREALTY_DESC</description> <description>PLG_SYSTEM_MOKOSUITEREALTY_DESC</description>
<namespace path="src">Moko\Plugin\System\MokoSuiteRealty</namespace> <namespace path="src">Moko\Plugin\System\MokoSuiteRealty</namespace>
@@ -3,7 +3,7 @@
<name>Web Services - MokoSuite Realty</name> <name>Web Services - MokoSuite Realty</name>
<element>mokosuiterealty</element> <element>mokosuiterealty</element>
<author>Moko Consulting</author> <author>Moko Consulting</author>
<version>01.00.36</version> <version>01.00.40</version>
<license>GPL-3.0-or-later</license> <license>GPL-3.0-or-later</license>
<namespace path="src">Moko\Plugin\WebServices\MokoSuiteRealty</namespace> <namespace path="src">Moko\Plugin\WebServices\MokoSuiteRealty</namespace>
<files><folder>src</folder><folder>services</folder></files> <files><folder>src</folder><folder>services</folder></files>
+1 -1
View File
@@ -2,7 +2,7 @@
<extension type="package" method="upgrade"> <extension type="package" method="upgrade">
<name>Package - MokoSuite Realty</name> <name>Package - MokoSuite Realty</name>
<packagename>mokosuiterealty</packagename> <packagename>mokosuiterealty</packagename>
<version>01.00.36</version> <version>01.00.40</version>
<creationDate>2026-06-21</creationDate> <creationDate>2026-06-21</creationDate>
<author>Moko Consulting</author> <author>Moko Consulting</author>
<authorEmail>hello@mokoconsulting.tech</authorEmail> <authorEmail>hello@mokoconsulting.tech</authorEmail>
+61 -61
View File
@@ -1,92 +1,110 @@
<?php <?php
/** /**
* MokoSuite Realty Package Install Script * @package MokoSuiteRealty
* * @subpackage pkg_mokosuiterealty
* @package MokoSuite Realty
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GPL-3.0-or-later * @license GNU General Public License version 3 or later; see LICENSE
*/ */
defined('_JEXEC') or die; defined('_JEXEC') or die;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\Installer\InstallerAdapter; use Joomla\CMS\Installer\InstallerAdapter;
use Joomla\Database\DatabaseInterface; use Joomla\CMS\Log\Log;
/**
* Package installation script for MokoSuiteRealty.
*/
class Pkg_MokoSuiteRealtyInstallerScript class Pkg_MokoSuiteRealtyInstallerScript
{ {
public function postflight(string $type, InstallerAdapter $adapter): void public function postflight(string $type, InstallerAdapter $adapter): void
{ {
if ($type === 'install') // 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))
{ {
$missing = $this->verifyChildren($adapter); Factory::getApplication()->enqueueMessage(
'<h4>MokoSuiteRealty did not install correctly.</h4>'
. '<p>The following bundled extensions are missing: '
. htmlspecialchars(implode(', ', $missing), ENT_QUOTES) . '</p>'
. '<p>Please uninstall MokoSuiteRealty and reinstall the full package.</p>',
'error'
);
if (!empty($missing)) return;
{
Factory::getApplication()->enqueueMessage(
'<strong>MokoSuite Realty — Incomplete Installation</strong><br>'
. 'The following extensions failed to install: '
. implode(', ', $missing)
. '.<br>Please check file permissions and server logs, then reinstall the package.',
'error'
);
return;
}
$this->enablePlugin('system', 'mokosuiterealty');
$this->enablePlugin('webservices', 'mokosuiterealty');
} }
$this->warnMissingLicenseKey(); $this->warnMissingLicenseKey();
} }
private function verifyChildren(InstallerAdapter $adapter): array /**
* 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 = <file> "type"; element =
* <file> "id" (for plugins, strip a leading plg_<group>_); plugins also match
* folder = <file> "group".
*
* FAILS OPEN: any error returns [] so a transient glitch never fakes a failure.
*/
private function missingChildExtensions($adapter): array
{ {
try try
{ {
$manifest = $adapter->getParent()->getManifest(); $manifest = $adapter->getParent()->getManifest();
$files = $manifest->files->file ?? [];
if (!$files) if (!$manifest || !isset($manifest->files) || !isset($manifest->files->file))
{ {
return []; return [];
} }
$db = Factory::getContainer()->get(DatabaseInterface::class); $db = Factory::getDbo();
$missing = []; $missing = [];
foreach ($files as $file) foreach ($manifest->files->file as $file)
{ {
$type = (string) ($file['type'] ?? ''); $attrs = $file->attributes();
$id = (string) ($file['id'] ?? ''); $id = isset($attrs['id']) ? (string) $attrs['id'] : '';
$group = (string) ($file['group'] ?? ''); $exType = isset($attrs['type']) ? (string) $attrs['type'] : '';
if ($type === '' || $id === '') if ($id === '' || $exType === '')
{ {
continue; continue;
} }
$element = ($type === 'plugin' && $group !== '') $group = isset($attrs['group']) ? (string) $attrs['group'] : '';
? preg_replace('/^plg_' . preg_quote($group, '/') . '_/', '', $id) $element = $id;
: $id;
// Plugin element in #__extensions is the id minus any leading plg_<group>_.
if ($exType === 'plugin' && $group !== '')
{
$prefix = 'plg_' . $group . '_';
if (strpos($element, $prefix) === 0)
{
$element = substr($element, \strlen($prefix));
}
}
$query = $db->getQuery(true) $query = $db->getQuery(true)
->select('COUNT(*)') ->select('COUNT(*)')
->from($db->quoteName('#__extensions')) ->from($db->quoteName('#__extensions'))
->where($db->quoteName('element') . ' = ' . $db->quote($element)) ->where($db->quoteName('element') . ' = ' . $db->quote($element))
->where($db->quoteName('type') . ' = ' . $db->quote($type)); ->where($db->quoteName('type') . ' = ' . $db->quote($exType));
if ($type === 'plugin' && $group !== '') if ($exType === 'plugin' && $group !== '')
{ {
$query->where($db->quoteName('folder') . ' = ' . $db->quote($group)); $query->where($db->quoteName('folder') . ' = ' . $db->quote($group));
} }
$db->setQuery($query); if ((int) $db->setQuery($query)->loadResult() === 0)
if ((int) $db->loadResult() === 0)
{ {
$missing[] = htmlspecialchars($type . ': ' . $id, ENT_QUOTES, 'UTF-8'); $label = trim((string) $file);
$missing[] = $label !== '' ? preg_replace('/\.zip$/i', '', $label) : $id;
} }
} }
@@ -94,35 +112,16 @@ class Pkg_MokoSuiteRealtyInstallerScript
} }
catch (\Throwable $e) catch (\Throwable $e)
{ {
// Fail open — never fake a failure on a glitch.
return []; return [];
} }
} }
private function enablePlugin(string $group, string $element): void
{
try
{
$db = Factory::getContainer()->get(DatabaseInterface::class);
$db->setQuery(
$db->getQuery(true)
->update($db->quoteName('#__extensions'))
->set($db->quoteName('enabled') . ' = 1')
->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
->where($db->quoteName('folder') . ' = ' . $db->quote($group))
->where($db->quoteName('element') . ' = ' . $db->quote($element))
);
$db->execute();
}
catch (\Throwable $e)
{
}
}
private function warnMissingLicenseKey(): void private function warnMissingLicenseKey(): void
{ {
try try
{ {
$db = Factory::getContainer()->get(DatabaseInterface::class); $db = Factory::getDbo();
$app = Factory::getApplication(); $app = Factory::getApplication();
$query = $db->getQuery(true) $query = $db->getQuery(true)
@@ -164,6 +163,7 @@ class Pkg_MokoSuiteRealtyInstallerScript
} }
catch (\Throwable $e) catch (\Throwable $e)
{ {
// Silent — avoid breaking install if update_sites query fails
} }
} }
} }