From d7e679b7b28d07d65105746f3154572f7b7a06d3 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Thu, 28 May 2026 17:10:29 -0500 Subject: [PATCH 1/4] fix(cli): correct element prefix and display name in updates_xml_build - Add type prefix (mod_, com_, tpl_, lib_) to in updates.xml so it matches Joomla's #__extensions table. Previously only packages got their prefix re-added after the strip on line 178. - Prefer human-readable name from .mokogitea/manifest.xml when the Joomla manifest is a technical prefixed name (mod_foo). Prevents display names like "Module - mod_mokojoomhero". - Existing "Type - " prefix strip still prevents doubling when the language key already resolves to "Module - MokoJoomHero". Authored-by: Moko Consulting Co-Authored-By: Claude Opus 4.6 (1M context) --- cli/updates_xml_build.php | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/cli/updates_xml_build.php b/cli/updates_xml_build.php index 310afe6..fb46371 100644 --- a/cli/updates_xml_build.php +++ b/cli/updates_xml_build.php @@ -228,6 +228,12 @@ if (empty($extType)) { $extType = 'component'; } +// If extName is still a technical/prefixed name (mod_foo, tpl_foo), prefer +// the human-readable name from .mokogitea/manifest.xml +if (preg_match('/^(pkg_|com_|mod_|plg_\w+_|tpl_|lib_)/i', $extName) && !empty($detectedName)) { + $extName = $detectedName; +} + // Build display name with type prefix (e.g. "Package - MokoWaaS") $typeDisplayMap = [ 'package' => 'Package', @@ -239,6 +245,8 @@ $typeDisplayMap = [ 'file' => 'File', ]; $typeDisplay = $typeDisplayMap[$extType] ?? ucfirst($extType); +// Strip existing type prefix to avoid doubling (e.g. "Template - Template - MokoOnyx") +$extName = preg_replace('/^(' . implode('|', array_map('preg_quote', $typeDisplayMap)) . ')\s*-\s*/i', '', $extName); $displayName = "{$typeDisplay} - {$extName}"; // -- Build type prefix -------------------------------------------------------- @@ -365,9 +373,17 @@ function buildEntry( $lines[] = ' '; $lines[] = " {$displayName}"; $lines[] = " {$displayName} {$stabilityLabel} build."; - // Element in updates.xml must match what Joomla stores in #__extensions - // For packages: pkg_elementname. For plugins: elementname (folder handles grouping). - $dbElement = ($extType === 'package') ? "pkg_{$extElement}" : $extElement; + // Element in updates.xml must match what Joomla stores in #__extensions. + // Plugins are stored as bare element (folder handles grouping). + // All other types need their prefix: mod_, com_, tpl_, pkg_, lib_. + $prefixMap = [ + 'package' => 'pkg_', + 'module' => 'mod_', + 'component' => 'com_', + 'template' => 'tpl_', + 'library' => 'lib_', + ]; + $dbElement = isset($prefixMap[$extType]) ? $prefixMap[$extType] . $extElement : $extElement; $lines[] = " {$dbElement}"; $lines[] = " {$extType}"; $lines[] = $clientTag; -- 2.52.0 From 32e34fc936e7c80c6bcb6d01502b09d431b732cb Mon Sep 17 00:00:00 2001 From: "gitea-actions[bot]" Date: Thu, 28 May 2026 22:10:46 +0000 Subject: [PATCH 2/4] chore(version): auto-bump patch 09.03.01-dev [skip ci] --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cb8bf56..e072b57 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ DEFGROUP: MokoStandards.Root INGROUP: MokoStandards REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform PATH: /README.md -VERSION: 09.03.00 +VERSION: 09.03.01 BRIEF: Project overview and documentation --> -- 2.52.0 From 1cbdaa0c37d77096b41244ad34cd75a90d13b5e0 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Thu, 28 May 2026 17:15:11 -0500 Subject: [PATCH 3/4] fix(cli): add module= attribute extraction to element detection Joomla modules declare their element via the module="mod_foo" attribute on the entry , not via an tag. Both manifest_element.php and release_package.php were missing this extraction, causing incorrect element names and ZIP filenames for module-type extensions. Added module="..." regex check in the element detection chain for both files, matching what updates_xml_build.php already had. Authored-by: Moko Consulting Co-Authored-By: Claude Opus 4.6 (1M context) --- cli/manifest_element.php | 5 ++++- cli/release_package.php | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cli/manifest_element.php b/cli/manifest_element.php index a2af665..db0fdd8 100644 --- a/cli/manifest_element.php +++ b/cli/manifest_element.php @@ -112,10 +112,13 @@ switch (true) { $extFolder = $gm[1]; } - // Element name: , plugin= attribute, , or filename + // Element name: , module= attribute, plugin= attribute, , or filename if (preg_match('/([^<]+)<\/element>/', $xml, $em)) { $extElement = $em[1]; } + if (empty($extElement) && preg_match('/module="([^"]*)"/', $xml, $mm)) { + $extElement = $mm[1]; + } if (empty($extElement) && preg_match('/plugin="([^"]*)"/', $xml, $pm)) { $extElement = $pm[1]; } diff --git a/cli/release_package.php b/cli/release_package.php index 134c572..4d5851c 100644 --- a/cli/release_package.php +++ b/cli/release_package.php @@ -213,10 +213,13 @@ if ($extManifest !== null) { $extFolder = $gm[1]; } - // Element name: , plugin= attribute, , or filename + // Element name: , module= attribute, plugin= attribute, , or filename if (preg_match('/([^<]+)<\/element>/', $xml, $em)) { $extElement = $em[1]; } + if ($extElement === '' && preg_match('/module="([^"]*)"/', $xml, $mm)) { + $extElement = $mm[1]; + } if ($extElement === '' && preg_match('/plugin="([^"]*)"/', $xml, $pm)) { $extElement = $pm[1]; } -- 2.52.0 From 048d1f49144a973d608d24df2be0dfaa6f0b49e5 Mon Sep 17 00:00:00 2001 From: "gitea-actions[bot]" Date: Thu, 28 May 2026 22:15:35 +0000 Subject: [PATCH 4/4] chore(version): auto-bump patch 09.03.02-dev [skip ci] --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e072b57..4db56e4 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ DEFGROUP: MokoStandards.Root INGROUP: MokoStandards REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform PATH: /README.md -VERSION: 09.03.01 +VERSION: 09.03.02 BRIEF: Project overview and documentation --> -- 2.52.0