fix: derive Joomla element name from package_type + repo name #635
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The Joomla update server uses the manifest
<name>field directly as the<element>inupdates.xml. This produces incorrect element names that don't match what Joomla registers in#__extensions.Current behavior:
Expected behavior:
Joomla's updater matches updates by
element+type+client_id. When the element name doesn't match, updates are invisible.How Joomla Actually Derives Element Names (from source)
Analyzed from
joomla-cms/6.1-dev/libraries/src/Installer/.Base class:
InstallerAdapter::getElement()Key: Base class uses
<element>tag first, falls back to<name>, then lowercases and strips non-alphanumeric chars viaInputFilter::clean('cmd').PackageAdapter::getElement()
Source of element:
<packagename>tag (NOT<name>), prefixed withpkg_. Thecmdfilter lowercases and strips special chars.ComponentAdapter::getElement()
Source:
<element>tag or<name>tag from base class, prefixed withcom_.ModuleAdapter::getElement()
Source:
<element>tag (J4+), ormoduleattribute on files (legacy). No prefix added — modules already includemod_in their element name.PluginAdapter::getElement()
Source: The attribute matching the extension type (e.g.
plugin=\"name\") on the files element. No prefix — plugins use bare names.LibraryAdapter::getElement()
Source:
<libraryname>tag. No prefix added — libraries already includelib_in their name.TemplateAdapter
No
getElement()override — uses base class (<element>or<name>, lowercased).Summary Table
<packagename>pkg_<element>or<name>com_(if missing)<element>tagmod_)plugin=\"name\"file attr<libraryname>lib_)<element>or<name><element>or<name>Proposed Fix
In
services/updateserver/joomla.go,resolveExtensionMetadata()should derive the element name based onextType:For packages, MokoGitea should use the
<packagename>field frompkg_mokosuitebackup.xmlif available, or derive from the repo name. Theelement_namemanifest API field should remain as an explicit override.Client ID Mapping
The
<client>tag in updates.xml maps toclient_id:\"site\"→client_id = 0\"administrator\"→client_id = 1Packages always use
client_id = 0(site) in#__extensions, regardless of their children. The update feed must match.Affected
All Joomla repos using the built-in update server. Currently blocking update delivery for MokoSuiteBackup.