From 4dbcf0fe0e2ec18350047594c9d6b4687ffac582 Mon Sep 17 00:00:00 2001 From: Luis Fernando Saisa Lopez Date: Mon, 29 Sep 2014 13:47:48 -0400 Subject: [PATCH] BUG 378 "Upgrading plugins error. The version..." SOLVED - Upgrading plugins error. The version never changes. The code is already updated. - Problema resuelto, en la actualizacion de un plugins, en el listado que se mustra en la columna Version, se mostrara la version del plugins actualizado. Disponible para la version 2.8 de ProcessMaker. --- .../engine/classes/model/AddonsManager.php | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/workflow/engine/classes/model/AddonsManager.php b/workflow/engine/classes/model/AddonsManager.php index fa3f9f69e..dd815066b 100644 --- a/workflow/engine/classes/model/AddonsManager.php +++ b/workflow/engine/classes/model/AddonsManager.php @@ -27,7 +27,7 @@ class AddonsManager extends BaseAddonsManager */ public function getDownloadFilename() - { + { $filename = $this->getAddonDownloadFilename(); if (!isset($filename) || empty($filename)) { $filename = "download.tar"; @@ -37,7 +37,7 @@ class AddonsManager extends BaseAddonsManager } public function getDownloadDirectory() - { + { $dir = PATH_DATA . "upgrade/{$this->getStoreId()}_{$this->getAddonName()}"; if (!file_exists($dir)) { mkdir($dir, 0777, true); @@ -52,7 +52,7 @@ class AddonsManager extends BaseAddonsManager * if file exists but md5 for the download is not available. */ public function checkDownload() - { + { $filename = $this->getDownloadFilename(); if (!file_exists($filename)) { return false; @@ -70,7 +70,7 @@ class AddonsManager extends BaseAddonsManager * @return bool true if is of type 'plugin', false otherwise */ public function isPlugin() - { + { return ($this->getAddonType() == 'plugin'); } @@ -166,17 +166,17 @@ class AddonsManager extends BaseAddonsManager return (null); } - /////// + $oPluginRegistry = &PMPluginRegistry::getSingleton(); + $details = $oPluginRegistry->getPluginDetails($this->getAddonName() . ".php"); + $v = (!($details == null))? $details->iVersion : null; + + if ($v != "") { + return ($v); + } + if (file_exists(PATH_PLUGINS . $this->getAddonName() . PATH_SEP . "VERSION")) { return (trim(file_get_contents(PATH_PLUGINS . $this->getAddonName() . PATH_SEP . "VERSION"))); } - - /////// - $oPluginRegistry = &PMPluginRegistry::getSingleton(); - $details = $oPluginRegistry->getPluginDetails($this->getAddonName() . ".php"); - - $v = (!($details == null))? $details->iVersion : null; - return ($v); } else { if ($this->getAddonType() == "core") { throw new Exception("Addon type \"" . $this->getAddonType() . "\" unsupported");