-
Bug
-
Resolution: Done
-
Low
-
None
When the updates API receives a request with a wrong or non-existent plugin, it currently returns the information of a random plugin. This issue was discovered and reported by pholden and dobedobedoh on MDL-80516.
Example:
$ curl --silent -X POST https://download.moodle.org/api/1.3/updates.php -d "format=json&version=2023100902.02&branch=4.3&plugins=mod_customcert@,@" | python -m json.tool
|
{
|
"apiver": "1.3",
|
"forbranch": "4.3",
|
"forversion": "2023100902.02",
|
"provider": "https://download.moodle.org/api/1.3/updates.php",
|
"status": "OK",
|
"ticket": "JUM5JTkxNSVGOCUzRiU4NSU3RHolRTIlOTclRDglRDElQjMlM0NDJUI5TyVDOSVDRSVBRlYyJUNFJTdGdiVCRCVBNCUxRSUzQSVBOCU3QyUwQiVERUYlMUIlODUlN0IlOEMlODlM",
|
"timegenerated": 1705008740,
|
"updates": {
|
"": [
|
{
|
"download": "https://moodle.org/plugins/download.php/30812/FastTest_PlugIn_moodle43_2024010582.zip",
|
"downloadmd5": "37790c5519416948ad5db0ea9f32e6ba",
|
"maturity": 200,
|
"release": "V8.2",
|
"url": "https://moodle.org/plugins/pluginversion.php?id=30812",
|
"version": "2024010582"
|
}
|
],
|
"core": [
|
{
|
"branch": "4.03",
|
"date": 1703210426,
|
"download": "https://download.moodle.org/download.php/direct/stable403/moodle-latest-403.zip",
|
"maturity": 200,
|
"norelease_index_info": {
|
"branch": "MOODLE_403_STABLE",
|
"date": 1704366120,
|
"githash": "d5d0774",
|
"tgz": {
|
"md5": true,
|
"sha256": true,
|
"size": 66795995
|
},
|
"version": "4.3.2+",
|
"zip": {
|
"md5": true,
|
"sha256": true,
|
"size": 87838754
|
}
|
},
|
"release": "4.3.2+ (Build: 20240104)",
|
"release_index_info": {
|
"branch": "MOODLE_403_STABLE",
|
"date": 1703210426,
|
"githash": "f810374",
|
"tgz": {
|
"md5": true,
|
"sha256": true,
|
"size": 66796530
|
},
|
"version": "4.3.2",
|
"zip": {
|
"md5": true,
|
"sha256": true,
|
"size": 87835214
|
}
|
},
|
"url": "https://download.moodle.org",
|
"version": 2023100902.02,
|
"windows": {
|
"size": 230471849
|
}
|
},
|
{
|
"branch": "4.04",
|
"date": 1704366113,
|
"download": "https://download.moodle.org/download.php/direct/moodle/moodle-latest.zip",
|
"maturity": 50,
|
"norelease_index_info": {
|
"branch": "main",
|
"date": 1704366113,
|
"githash": "9587029",
|
"tgz": {
|
"md5": true,
|
"sha256": true,
|
"size": 70156644
|
},
|
"version": "4.4dev",
|
"zip": {
|
"md5": true,
|
"sha256": true,
|
"size": 92534319
|
}
|
},
|
"release": "4.4dev (Build: 20240104)",
|
"url": "https://download.moodle.org",
|
"version": 2024010400,
|
"windows": {
|
"size": 235170414
|
}
|
}
|
],
|
"mod_customcert": [
|
{
|
"download": "https://moodle.org/plugins/download.php/29392/mod_customcert_moodle43_2023042402.zip",
|
"downloadmd5": "30d31c0a10c5af4ee57955fd94147540",
|
"maturity": 200,
|
"release": "4.2.2",
|
"url": "https://moodle.org/plugins/pluginversion.php?id=29392",
|
"version": "2023042402"
|
}
|
]
|
}
|
}
|
The "plugins" parameter is a list of non-core plugins separated by commas, used to check for updates. Each element should follow the format "component@currentversion". In the given example, the value is "mod_customcert@,@", where the first plugin, mod_customcert, has no specified version, and the second plugin has both the name and version empty. This is an incorrect value that needs validation before responding to the request.
- will help resolve
-
MDL-80516 Unable to upgrade with error Unknown plugin type: core
- Closed