diff --git a/workflow/engine/classes/class.patch.php b/workflow/engine/classes/class.patch.php index 75b39fa10..efcd15065 100644 --- a/workflow/engine/classes/class.patch.php +++ b/workflow/engine/classes/class.patch.php @@ -26,19 +26,27 @@ class p11835 extends patch */ static public function isApplicable() { - if (! class_exists('System')) { + if (!class_exists('System')) { G::LoadClass("System"); } patch::$isPathchable = false; $con = Propel::getConnection("workflow"); - $stmt = $con->prepareStatement("describe TASK;"); + $stmt = $con->prepareStatement("SHOW TABLES LIKE 'TASK'"); $rs = $stmt->executeQuery(); $rs->next(); - while($row = $rs->getRow()) { + $row = $rs->getRow(); + if (empty($row) === true) { + return patch::$isPathchable; + } + + $stmt = $con->prepareStatement("DESCRIBE TASK"); + $rs = $stmt->executeQuery(); + $rs->next(); + while ($row = $rs->getRow()) { if ($row ['Field'] == "TAS_GROUP_VARIABLE") { - $version = System::getVersion (); - $version = explode('-',$version); + $version = System::getVersion(); + $version = explode('-', $version); if ($version[0] == '2.5.1') { echo "Version " . $version[0] . " Patch\n"; patch::$isPathchable = true; @@ -49,7 +57,7 @@ class p11835 extends patch } return patch::$isPathchable; } - + public static function pmVersion($version) { if (preg_match("/^\D*([\d\.]+)\D*$/", $version, $matches)) {