fix: ensure modules stay published with correct positions on update
Universal: Auto Version Bump / Version Bump (push) Has been cancelled
Platform: moko-platform CI / Gate 1: Code Quality (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.1) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.2) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.3) (push) Has been cancelled
Platform: moko-platform CI / Gate 3: Self-Health Check (push) Has been cancelled
Platform: moko-platform CI / Gate 4: Governance (push) Has been cancelled
Platform: moko-platform CI / Gate 5: Template Integrity (push) Has been cancelled
Platform: moko-platform CI / CI Summary (push) Has been cancelled
Platform: moko-platform CI / Gate 1: Code Quality (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.1) (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.2) (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.3) (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 3: Self-Health Check (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 4: Governance (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 5: Template Integrity (pull_request) Has been cancelled
Platform: moko-platform CI / CI Summary (pull_request) Has been cancelled
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Has been cancelled
Generic: Repo Health / Access control (push) Has been cancelled
Generic: Repo Health / Scripts governance (push) Has been cancelled
Generic: Repo Health / Repository health (push) Has been cancelled
Generic: Repo Health / Site Health (push) Has been cancelled
Generic: Repo Health / Report Issues (push) Has been cancelled
Universal: Secret Scanning / Gitleaks Secret Scan (pull_request) Has been cancelled
Universal: PR Check / Branch Policy (pull_request) Has been cancelled
Universal: PR Check / Validate PR (pull_request) Has been cancelled
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
Generic: Repo Health / Access control (pull_request) Has been cancelled
Generic: Repo Health / Scripts governance (pull_request) Has been cancelled
Generic: Repo Health / Repository health (pull_request) Has been cancelled
Generic: Repo Health / Site Health (pull_request) Has been cancelled
Generic: Repo Health / Report Issues (pull_request) Has been cancelled
Universal: Auto Version Bump / Version Bump (push) Has been cancelled
Platform: moko-platform CI / Gate 1: Code Quality (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.1) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.2) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.3) (push) Has been cancelled
Platform: moko-platform CI / Gate 3: Self-Health Check (push) Has been cancelled
Platform: moko-platform CI / Gate 4: Governance (push) Has been cancelled
Platform: moko-platform CI / Gate 5: Template Integrity (push) Has been cancelled
Platform: moko-platform CI / CI Summary (push) Has been cancelled
Platform: moko-platform CI / Gate 1: Code Quality (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.1) (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.2) (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.3) (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 3: Self-Health Check (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 4: Governance (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 5: Template Integrity (pull_request) Has been cancelled
Platform: moko-platform CI / CI Summary (pull_request) Has been cancelled
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Has been cancelled
Generic: Repo Health / Access control (push) Has been cancelled
Generic: Repo Health / Scripts governance (push) Has been cancelled
Generic: Repo Health / Repository health (push) Has been cancelled
Generic: Repo Health / Site Health (push) Has been cancelled
Generic: Repo Health / Report Issues (push) Has been cancelled
Universal: Secret Scanning / Gitleaks Secret Scan (pull_request) Has been cancelled
Universal: PR Check / Branch Policy (pull_request) Has been cancelled
Universal: PR Check / Validate PR (pull_request) Has been cancelled
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
Generic: Repo Health / Access control (pull_request) Has been cancelled
Generic: Repo Health / Scripts governance (pull_request) Has been cancelled
Generic: Repo Health / Repository health (pull_request) Has been cancelled
Generic: Repo Health / Site Health (pull_request) Has been cancelled
Generic: Repo Health / Report Issues (pull_request) Has been cancelled
Module setup methods now update position and published state on reinstall/update instead of returning early when module exists. Also add mokosuite_dbip to plugin enable list. Modules: cpanel→top, menu→menu, cache→status
This commit is contained in:
+32
-6
@@ -77,6 +77,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
$this->enablePlugin('system', 'mokosuite_tenant');
|
||||
$this->enablePlugin('system', 'mokosuite_devtools');
|
||||
$this->enablePlugin('system', 'mokosuite_offline');
|
||||
$this->enablePlugin('system', 'mokosuite_dbip');
|
||||
$this->enablePlugin('webservices', 'mokosuite');
|
||||
$this->enablePlugin('task', 'mokosuitedemo');
|
||||
$this->enablePlugin('task', 'mokosuitesync');
|
||||
@@ -958,13 +959,22 @@ class Pkg_MokosuiteInstallerScript
|
||||
|
||||
// Check if a module instance already exists in #__modules
|
||||
$query = $db->getQuery(true)
|
||||
->select('COUNT(*)')
|
||||
->select('id')
|
||||
->from($db->quoteName('#__modules'))
|
||||
->where($db->quoteName('module') . ' = ' . $db->quote('mod_mokosuite_cpanel'));
|
||||
$db->setQuery($query);
|
||||
$existingId = (int) $db->loadResult();
|
||||
|
||||
if ((int) $db->loadResult() > 0)
|
||||
if ($existingId > 0)
|
||||
{
|
||||
// Ensure it's published with correct position
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->update('#__modules')
|
||||
->set('published = 1')
|
||||
->set($db->quoteName('position') . ' = ' . $db->quote('top'))
|
||||
->where('id = ' . $existingId)
|
||||
)->execute();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1028,13 +1038,21 @@ class Pkg_MokosuiteInstallerScript
|
||||
// Check if module instance exists
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->select('COUNT(*)')
|
||||
->select('id')
|
||||
->from($db->quoteName('#__modules'))
|
||||
->where($db->quoteName('module') . ' = ' . $db->quote('mod_mokosuite_menu'))
|
||||
);
|
||||
$existingId = (int) $db->loadResult();
|
||||
|
||||
if ((int) $db->loadResult() > 0)
|
||||
if ($existingId > 0)
|
||||
{
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->update('#__modules')
|
||||
->set('published = 1')
|
||||
->set($db->quoteName('position') . ' = ' . $db->quote('menu'))
|
||||
->where('id = ' . $existingId)
|
||||
)->execute();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1091,13 +1109,21 @@ class Pkg_MokosuiteInstallerScript
|
||||
// Check if module instance exists
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->select('COUNT(*)')
|
||||
->select('id')
|
||||
->from($db->quoteName('#__modules'))
|
||||
->where($db->quoteName('module') . ' = ' . $db->quote('mod_mokosuite_cache'))
|
||||
);
|
||||
$existingId = (int) $db->loadResult();
|
||||
|
||||
if ((int) $db->loadResult() > 0)
|
||||
if ($existingId > 0)
|
||||
{
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->update('#__modules')
|
||||
->set('published = 1')
|
||||
->set($db->quoteName('position') . ' = ' . $db->quote('status'))
|
||||
->where('id = ' . $existingId)
|
||||
)->execute();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user