diff --git a/README.md b/README.md index cb8bf56..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.00 +VERSION: 09.03.02 BRIEF: Project overview and documentation --> 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]; } 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;