fix: update feed generates wrong element and type for Joomla packages #592
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 dynamic updates.xml feed generates incorrect values for Joomla package extensions:
<element>mokosuitehq</element>— should bepkg_mokosuitehq(full element with type prefix)<type>component</type>— should bepackage<client>site</client>— admin packages should beadministratorJoomla matches updates by
element+typeagainst#__extensions. When these don't match, the site can't find available updates.Expected
For a package extension
pkg_mokosuitehq:Current
Affected
Any Joomla package extension using MokoGitea's dynamic update feed. Currently blocks MokoSuiteHQ updates on all client sites.
Notes
The manifest API has
element_nameandpackage_typefields that could be used to populate these correctly. The feed generator should read from the manifest when available.Branch created:
feature/592-fix-update-feed-generates-wrong-element-Implementation Plan
Root Cause
resolveExtensionMetadata()inservices/updateserver/joomla.go(line 179-275) does not read from the repo manifest API. It only uses:strings.ToLower(repo.Name)→ e.g.mokosuitehq"component"update_stream_config)The manifest model (
models/repo/repo_manifest.go) hasElementNameandPackageTypefields that are already populated via the manifest API, but the feed generator never reads them.Fix Plan
File:
services/updateserver/joomla.goresolveExtensionMetadata(), add manifest as a fallback layer between repo defaults and config table:"package"should map to"administrator"not"0":Priority Cascade (after fix)
manifest_detect.phpstrings.ToLower(repo.Name)Files to Change
services/updateserver/joomla.goresolveExtensionMetadata(), fix client logicTesting
element_name=pkg_mokosuitehqandpackage_type=packageon MokoSuiteHQ manifestupdates.xmloutput has<element>pkg_mokosuitehq</element>,<type>package</type>,<client>administrator</client>Updated Plan — Manifest as Single Source of Truth
Change of approach
Instead of adding manifest as a fallback layer, the manifest API should be the primary and only source for extension metadata in the update feed. The config table fields (
ExtensionName,ExtensionType,DisplayName, etc.) and custom field overrides for these should be deprecated.Mapping: Manifest → updates.xml
element_name<element>strings.ToLower(repo.Name)package_type<type>"component"display_name<name>"{owner} - {repo}"target_version<targetplatform version="">"(5|6)\..*"php_minimum<php_minimum>description<description>Client field derivation
Derived from
package_type:package,component,library,file→administratormodule,plugin,template→ check manifest or defaultsiteImplementation
File:
services/updateserver/joomla.go—resolveExtensionMetadata()Replace the config table + custom field cascade with a single manifest read:
Config table fields to deprecate
These fields in
update_stream_configare superseded by manifest:ExtensionName→manifest.element_nameExtensionType→manifest.package_typeDisplayName→manifest.display_nameTargetVersion→manifest.target_versionPHPMinimum→manifest.php_minimumDescription→manifest.descriptionKeep in config table (not in manifest):
DownloadGating— licensing/gating behaviorKeyPrefix— download key prefixSupportURL— info/support linkCustom fields to deprecate
Remove the "Extension Name", "Extension Type", "Display Name", "Target Version", "PHP Minimum", "Description" custom field lookups from
resolveExtensionMetadata().Migration path
manifest_detect.php --updateacross all Joomla repos to populate manifest fieldsStatus Update
The Go code fix is on branch
fix/manifest-update-feed(commitaeb36e4) but the feed is still broken because the fix hasn't been compiled and deployed to the production Gitea instance.Current feed output (still wrong):
Workaround needed now
Until the Go fix is deployed, set the manifest fields via API so the current code path (config table) picks them up:
The current code reads from config table → custom fields. Once the Go fix deploys, it will read from manifest instead.
Deployment needed
The
fix/manifest-update-feedbranch needs to be:make buildor CI)Blocked
MokoSuiteHQ updates on all client sites are blocked until either: