fix: set correct <client> per extension type in Joomla update feed (#611) #633

Closed
jmiller wants to merge 1 commits from fix/changelog-update into main
+15 -5
View File
@@ -383,12 +383,22 @@ func GenerateJoomlaXML(ctx context.Context, repo *repo_model.Repository, require
infoURL = meta.SupportURL
}
// Joomla <client> element uses string values per the update server spec.
// Joomla's XML parser maps these to client_id internally (0/1).
client := "site"
// Joomla <client> element must match the client_id stored in #__extensions.
// Joomla's update finder matches by (element, type, client_id, folder) —
// a mismatch causes extension_id=0 and the update never shows.
//
// Joomla hardcodes client_id per extension type in the installer adapters:
// component → client_id=1 (ComponentAdapter.php:900)
// package → client_id=0 (PackageAdapter.php:548)
// plugin → client_id=0 (PluginAdapter.php:492)
// library → client_id=0 (LibraryAdapter.php:420)
// file → client_id=0 (FileAdapter.php:422)
// module → client_id from manifest (0=site, 1=admin)
// template → client_id from manifest (0=site, 1=admin)
client := "site" // default: client_id=0
switch extType {
case "package", "component", "library", "file":
client = "administrator"
case "component":
client = "administrator" // client_id=1
}
u := xmlUpdate{