#797 - Non-bundled addons status incorrectly report as 'Update available' even though the newest version is installed.
| Identifier | #797 |
|---|---|
| Issue type | Minor issue (breaks specific functionality) |
| Title | Non-bundled addons status incorrectly report as 'Update available' even though the newest version is installed. |
| Status | Closed (cannot reproduce) |
| Handling member | Chris Graham |
| Addon | core_addon_management |
| Description | For Composr v9, the comparison of available addon mtime versus installed addon mtime in sources/addons.php (lines 53 and 62?) is incorrect. The '<' should be changed to '>' for both lines.
line 53: if ((!is_null($addon[0])) && ($available_addon['mtime']<$addon[0])) // If known to server, and updated should be: if ((!is_null($addon[0])) && ($available_addon['mtime']>$addon[0])) // If known to server, and updated line 62: if ((!is_null($addon[0])) && (!is_null($mtime)) && ($mtime<$addon[0])) // If server has it and is newer should be: if ((!is_null($addon[0])) && (!is_null($mtime)) && ($mtime>$addon[0])) // If server has it and is newer |
| Steps to reproduce | |
| Funded? | No |
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".
Comments
Stripping back and commenting the code we have...
$addon_data=http_download_file($url); /* Addon data from compo.sr server */
$available_addons=find_available_addons(); /* Addon data for the addons we've imported (files in imports/addons) */
foreach (unserialize($addon_data) as $i=>$addon) // $addon relates to "compo.sr"
{
foreach ($available_addons as $available_addon) // $available_addon relates to "imports/addons"
{
if ($available_addon['mtime']<$addon[0]) // If "imports/addons" < "compo.sr"
{
// Outdated
}
}
}