From: Tim Otten Date: Thu, 31 Oct 2013 00:11:10 +0000 (-0700) Subject: CRM-13685 - "Manage Extensions" - Fix upgrade check X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=46693bafab03a26933811d992e3550dd56067047;p=civicrm-core.git CRM-13685 - "Manage Extensions" - Fix upgrade check ---------------------------------------- * CRM-13685: "Manage Extension" screen should use "<" to determine upgradeability http://issues.civicrm.org/jira/browse/CRM-13685 --- diff --git a/CRM/Admin/Page/Extensions.php b/CRM/Admin/Page/Extensions.php index a6bc3528c0..d92c504e37 100644 --- a/CRM/Admin/Page/Extensions.php +++ b/CRM/Admin/Page/Extensions.php @@ -217,6 +217,11 @@ class CRM_Admin_Page_Extensions extends CRM_Core_Page_Basic { 'key' => $row['key'], ) ); + if (isset($localExtensionRows[$info->key])) { + if (version_compare($localExtensionRows[$info->key]['version'], $info->version, '<')) { + $row['is_upgradeable'] = TRUE; + } + } $remoteExtensionRows[$row['id']] = $row; } $this->assign('remoteExtensionRows', $remoteExtensionRows); diff --git a/templates/CRM/Admin/Page/Extensions/Main.tpl b/templates/CRM/Admin/Page/Extensions/Main.tpl index dea6ea4dfe..d9c8a8331f 100644 --- a/templates/CRM/Admin/Page/Extensions/Main.tpl +++ b/templates/CRM/Admin/Page/Extensions/Main.tpl @@ -22,7 +22,7 @@ Depends: CRM/common/enableDisable.tpl and CRM/common/jsortable.tpl  {$row.label}
({$row.key}) - {if $extAddNewEnabled && $remoteExtensionRows[$extKey] && $row.version != $remoteExtensionRows[$extKey].version} + {if $extAddNewEnabled && $remoteExtensionRows[$extKey] && $remoteExtensionRows[$extKey].is_upgradeable} {capture assign='upgradeURL'}{crmURL p='civicrm/admin/extensions' q="action=update&id=$extKey&key=$extKey"}{/capture}
{ts 1=$upgradeURL}Version {$remoteExtensionRows[$extKey].version} is available. Upgrade{/ts}
{/if}