From 1cbdaa0c37d77096b41244ad34cd75a90d13b5e0 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Thu, 28 May 2026 17:15:11 -0500 Subject: [PATCH] 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]; }