feat: prefer MokoOnyx over MokoCassiopeia — lock Onyx, unlock Cassiopeia
Repo Health / Access control (push) Failing after 4s
Standards Compliance / Secret Scanning (push) Failing after 2s
Standards Compliance / License Header Validation (push) Successful in 2s
Standards Compliance / Repository Structure Validation (push) Successful in 3s
Standards Compliance / Coding Standards Check (push) Failing after 3s
Standards Compliance / Workflow Configuration Check (push) Failing after 3s
Standards Compliance / Documentation Quality Check (push) Successful in 3s
Standards Compliance / README Completeness Check (push) Successful in 2s
Standards Compliance / Git Repository Hygiene (push) Successful in 3s
Standards Compliance / Version Consistency Check (push) Successful in 35s
Standards Compliance / Line Length Check (push) Failing after 3s
Standards Compliance / File Naming Standards (push) Successful in 2s
Standards Compliance / Insecure Code Pattern Detection (push) Successful in 3s
Standards Compliance / Script Integrity Validation (push) Successful in 39s
Standards Compliance / Code Complexity Analysis (push) Successful in 35s
Standards Compliance / Dead Code Detection (push) Successful in 4s
Standards Compliance / File Size Limits (push) Successful in 2s
Standards Compliance / Binary File Detection (push) Successful in 4s
Standards Compliance / TODO/FIXME Tracking (push) Successful in 3s
Standards Compliance / Code Duplication Detection (push) Successful in 39s
Standards Compliance / Dependency Vulnerability Scanning (push) Successful in 34s
Standards Compliance / Broken Link Detection (push) Successful in 4s
Standards Compliance / API Documentation Coverage (push) Successful in 2s
Standards Compliance / Accessibility Check (push) Successful in 3s
Standards Compliance / Performance Metrics (push) Successful in 2s
Standards Compliance / Unused Dependencies Check (push) Successful in 39s
Standards Compliance / Enterprise Readiness Check (push) Failing after 37s
Standards Compliance / Terraform Configuration Validation (push) Successful in 5s
Standards Compliance / Repository Health Check (push) Failing after 34s
Repo Health / Release configuration (push) Has been skipped
Repo Health / Scripts governance (push) Has been skipped
Repo Health / Repository health (push) Has been skipped
Standards Compliance / Compliance Summary (push) Failing after 1s
Update MokoCassiopeia Payload / update-payload (push) Failing after 10s

If MokoOnyx is installed, lock it and set as default.
Unlock MokoCassiopeia to allow uninstall.
Falls back to MokoCassiopeia if Onyx not present.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jonathan Miller
2026-04-21 17:09:04 -05:00
parent 9eda3fd497
commit 3df40214f3
+44 -11
View File
@@ -210,10 +210,11 @@ class plgSystemMokoWaaSInstallerScript implements InstallerScriptInterface
}
/**
* Ensure mokocassiopeia template is installed and locked.
* Ensure the active Moko template is installed and locked.
*
* If the template exists in #__extensions, lock and protect it.
* If not found, attempt to install from the update server.
* Prefers MokoOnyx (successor). Falls back to MokoCassiopeia.
* If MokoOnyx is found, lock it and unlock MokoCassiopeia.
* If only MokoCassiopeia is found, lock it as before.
*
* @return void
*
@@ -221,17 +222,50 @@ class plgSystemMokoWaaSInstallerScript implements InstallerScriptInterface
*/
private function ensureMokoCassiopeia()
{
$db = Factory::getDbo();
$db = Factory::getDbo();
// Check for MokoOnyx first (successor template)
$query = $db->getQuery(true)
->select([$db->quoteName('extension_id'), $db->quoteName('enabled')])
->from($db->quoteName('#__extensions'))
->where($db->quoteName('element') . ' = '
. $db->quote('mokocassiopeia'))
->where($db->quoteName('type') . ' = '
. $db->quote('template'));
->where($db->quoteName('element') . ' = ' . $db->quote('mokoonyx'))
->where($db->quoteName('type') . ' = ' . $db->quote('template'));
$onyx = $db->setQuery($query)->loadObject();
$db->setQuery($query);
$template = $db->loadObject();
if ($onyx)
{
// Lock and protect MokoOnyx
$db->setQuery(
$db->getQuery(true)
->update($db->quoteName('#__extensions'))
->set($db->quoteName('enabled') . ' = 1')
->set($db->quoteName('locked') . ' = 1')
->set($db->quoteName('protected') . ' = 1')
->where($db->quoteName('extension_id') . ' = ' . (int) $onyx->extension_id)
)->execute();
$this->setDefaultTemplate('mokoonyx', 0);
// Unlock MokoCassiopeia if present (allow uninstall)
$db->setQuery(
$db->getQuery(true)
->update($db->quoteName('#__extensions'))
->set($db->quoteName('locked') . ' = 0')
->set($db->quoteName('protected') . ' = 0')
->where($db->quoteName('element') . ' = ' . $db->quote('mokocassiopeia'))
->where($db->quoteName('type') . ' = ' . $db->quote('template'))
)->execute();
return;
}
// Fallback: MokoCassiopeia
$query = $db->getQuery(true)
->select([$db->quoteName('extension_id'), $db->quoteName('enabled')])
->from($db->quoteName('#__extensions'))
->where($db->quoteName('element') . ' = ' . $db->quote('mokocassiopeia'))
->where($db->quoteName('type') . ' = ' . $db->quote('template'));
$template = $db->setQuery($query)->loadObject();
if ($template)
{
@@ -247,7 +281,6 @@ class plgSystemMokoWaaSInstallerScript implements InstallerScriptInterface
);
$db->execute();
// Set as default site template
$this->setDefaultTemplate('mokocassiopeia', 0);
return;