6 Commits

Author SHA1 Message Date
gitea-actions[bot] 27f4394899 chore(version): pre-release bump to 01.00.40-dev [skip ci] 2026-07-07 10:17:24 +00:00
jmiller 0ee73635c2 Merge pull request 'feat(menu): admin menu short-name constant COM_MOKOSUITEBEAUTY_SHORT' (#14) 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:43 +00:00
gitea-actions[bot] fd17d7391e 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:46:13 +00:00
gitea-actions[bot] ef9909b2b5 chore(version): pre-release bump to 01.00.38-dev [skip ci] 2026-07-06 22:45:31 +00:00
jmiller 7c1d760d16 feat(menu): use COM_MOKOSUITEBEAUTY_SHORT + wire admin language
Universal: PR Check / Branch Policy (pull_request) Successful in 2s
Universal: PR Check / Validate PR (pull_request) Failing after 8s
Universal: PR Check / Secret Scan (pull_request) Successful in 9s
Joomla: Metadata Validation / Validate Joomla Metadata (pull_request) Successful in 17s
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 12s
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:45:11 +00:00
jmiller faa1405f13 feat(menu): add COM_MOKOSUITEBEAUTY_SHORT short-name constant
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 22s
Claude-Session: https://claude.ai/code/session_01B9aZHSWbiiZykJD88pYx8R
2026-07-06 22:45:00 +00:00
10 changed files with 54 additions and 192 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.37 # 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"
+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.37 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.37 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.37 VERSION: 01.00.40
BRIEF: Security vulnerability reporting and handling policy BRIEF: Security vulnerability reporting and handling policy
--> -->
@@ -0,0 +1,3 @@
COM_MOKOSUITEBEAUTY="MokoSuite Beauty"
COM_MOKOSUITEBEAUTY_SHORT="Beauty"
COM_MOKOSUITEBEAUTY_XML_DESCRIPTION="MokoSuite Beauty 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.37</version> <version>01.00.40</version>
<namespace path="src">Moko\Component\MokoSuiteBeauty</namespace> <namespace path="src">Moko\Component\MokoSuiteBeauty</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_MOKOSUITEBEAUTY</menu> <menu>COM_MOKOSUITEBEAUTY_SHORT</menu>
<languages folder="admin/language">
<language tag="en-GB">en-GB/com_mokosuitebeauty.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.37</version> <version>01.00.40</version>
<php_minimum>8.3</php_minimum> <php_minimum>8.3</php_minimum>
<description>PLG_SYSTEM_MOKOSUITEBEAUTY_DESC</description> <description>PLG_SYSTEM_MOKOSUITEBEAUTY_DESC</description>
<namespace path="src">Moko\Plugin\System\MokoSuiteBeauty</namespace> <namespace path="src">Moko\Plugin\System\MokoSuiteBeauty</namespace>
@@ -3,7 +3,7 @@
<name>Web Services - MokoSuite Beauty</name> <name>Web Services - MokoSuite Beauty</name>
<element>mokosuitebeauty</element> <element>mokosuitebeauty</element>
<author>Moko Consulting</author> <author>Moko Consulting</author>
<version>01.00.37</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\MokoSuiteBeauty</namespace> <namespace path="src">Moko\Plugin\WebServices\MokoSuiteBeauty</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 Beauty</name> <name>Package - MokoSuite Beauty</name>
<packagename>mokosuitebeauty</packagename> <packagename>mokosuitebeauty</packagename>
<version>01.00.37</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>
+39 -183
View File
@@ -1,10 +1,9 @@
<?php <?php
/** /**
* MokoSuite Beauty Package Install Script * @package MokoSuiteBeauty
* * @subpackage pkg_mokosuitebeauty
* @package MokoSuite Beauty
* @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;
@@ -12,72 +11,50 @@ defined('_JEXEC') or die;
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\Installer\InstallerAdapter; use Joomla\CMS\Installer\InstallerAdapter;
use Joomla\CMS\Log\Log; use Joomla\CMS\Log\Log;
use Joomla\Database\DatabaseInterface;
class Pkg_mokosuitebeautyInstallerScript /**
* Package installation script for MokoSuiteBeauty.
*/
class Pkg_MokoSuiteBeautyInstallerScript
{ {
private string $savedDlid = '';
public function preflight(string $type, InstallerAdapter $adapter): bool
{
if ($type === 'update')
{
$this->savedDlid = $this->getExistingDlid();
}
return true;
}
public function postflight(string $type, InstallerAdapter $adapter): void public function postflight(string $type, InstallerAdapter $adapter): void
{ {
if ($this->savedDlid) $this->warnMissingLicenseKey();
{ }
$this->restoreDlid($this->savedDlid);
} private function warnMissingLicenseKey(): void
{
if ($type === 'install') try
{
$missing = $this->verifyChildren($adapter);
if (!empty($missing))
{
Factory::getApplication()->enqueueMessage(
'<strong>MokoSuite Beauty — 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', 'mokosuitebeauty');
$this->enablePlugin('webservices', 'mokosuitebeauty');
}
$dlid = $this->getExistingDlid();
if (empty($dlid))
{ {
$db = Factory::getDbo();
$app = Factory::getApplication(); $app = Factory::getApplication();
try $query = $db->getQuery(true)
->select([$db->quoteName('update_site_id'), $db->quoteName('extra_query')])
->from($db->quoteName('#__update_sites'))
->where('(' . $db->quoteName('name') . ' LIKE ' . $db->quote('%MokoSuiteBeauty%')
. ' OR ' . $db->quoteName('location') . ' LIKE ' . $db->quote('%MokoSuiteBeauty%') . ')')
->setLimit(1);
$db->setQuery($query);
$site = $db->loadObject();
if ($site)
{ {
$db = Factory::getContainer()->get(DatabaseInterface::class); $extraQuery = (string) ($site->extra_query ?? '');
$db->setQuery(
$db->getQuery(true) if (!empty($extraQuery) && strpos($extraQuery, 'dlid=') !== false)
->select($db->quoteName('update_site_id')) {
->from($db->quoteName('#__update_sites')) parse_str($extraQuery, $parsed);
->where($db->quoteName('name') . ' LIKE ' . $db->quote('%MokoSuite Beauty%'))
->setLimit(1) if (!empty($parsed['dlid']))
); {
$siteId = (int) $db->loadResult(); return;
$editUrl = $siteId }
? 'index.php?option=com_installer&task=updatesite.edit&update_site_id=' . $siteId }
: 'index.php?option=com_installer&view=updatesites';
$editUrl = 'index.php?option=com_installer&task=updatesite.edit&update_site_id=' . (int) $site->update_site_id;
} }
catch (\Throwable $e) else
{ {
$editUrl = 'index.php?option=com_installer&view=updatesites'; $editUrl = 'index.php?option=com_installer&view=updatesites';
} }
@@ -89,130 +66,9 @@ class Pkg_mokosuitebeautyInstallerScript
'warning' 'warning'
); );
} }
}
private function verifyChildren(InstallerAdapter $adapter): array
{
try
{
$manifest = $adapter->getParent()->getManifest();
$files = $manifest->files->file ?? [];
if (!$files)
{
return [];
}
$db = Factory::getContainer()->get(DatabaseInterface::class);
$missing = [];
foreach ($files as $file)
{
$type = (string) ($file['type'] ?? '');
$id = (string) ($file['id'] ?? '');
$group = (string) ($file['group'] ?? '');
if ($type === '' || $id === '')
{
continue;
}
$element = ($type === 'plugin' && $group !== '')
? preg_replace('/^plg_' . preg_quote($group, '/') . '_/', '', $id)
: $id;
$query = $db->getQuery(true)
->select('COUNT(*)')
->from($db->quoteName('#__extensions'))
->where($db->quoteName('element') . ' = ' . $db->quote($element))
->where($db->quoteName('type') . ' = ' . $db->quote($type));
if ($type === 'plugin' && $group !== '')
{
$query->where($db->quoteName('folder') . ' = ' . $db->quote($group));
}
$db->setQuery($query);
if ((int) $db->loadResult() === 0)
{
$missing[] = htmlspecialchars($type . ': ' . $id, ENT_QUOTES, 'UTF-8');
}
}
return $missing;
}
catch (\Throwable $e) catch (\Throwable $e)
{ {
return []; // Silent — avoid breaking install if update_sites query fails
}
}
private function getExistingDlid(): string
{
try
{
$db = Factory::getContainer()->get(DatabaseInterface::class);
$db->setQuery(
$db->getQuery(true)
->select($db->quoteName('extra_query'))
->from($db->quoteName('#__update_sites'))
->where($db->quoteName('name') . ' LIKE ' . $db->quote('%MokoSuite Beauty%'))
->setLimit(1)
);
$extraQuery = $db->loadResult() ?? '';
if (preg_match('/dlid=([a-zA-Z0-9]+)/', $extraQuery, $matches))
{
return $matches[1];
}
}
catch (\Throwable $e)
{
Log::add('Beauty install: failed to read DLID — ' . $e->getMessage(), Log::WARNING, 'mokosuite.beauty');
}
return '';
}
private function restoreDlid(string $dlid): void
{
try
{
$db = Factory::getContainer()->get(DatabaseInterface::class);
$db->setQuery(
$db->getQuery(true)
->update($db->quoteName('#__update_sites'))
->set($db->quoteName('extra_query') . ' = ' . $db->quote('dlid=' . $dlid))
->where($db->quoteName('name') . ' LIKE ' . $db->quote('%MokoSuite Beauty%'))
);
$db->execute();
}
catch (\Throwable $e)
{
Log::add('Beauty install: failed to restore DLID — ' . $e->getMessage(), Log::WARNING, 'mokosuite.beauty');
}
}
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)
{
Log::add('Beauty install: failed to enable ' . $group . '/' . $element . ' — ' . $e->getMessage(), Log::WARNING, 'mokosuite.beauty');
} }
} }
} }