From 93428bd8f23cad1fcb6d4a25172e6dc06ff19ca7 Mon Sep 17 00:00:00 2001 From: g4b0 Date: Thu, 28 Mar 2013 14:45:23 +0100 Subject: [PATCH] Solved json obj to array issue --- admin/code/LeftAndMain.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/admin/code/LeftAndMain.php b/admin/code/LeftAndMain.php index 9cc8c53644f..b1c47f26fe7 100644 --- a/admin/code/LeftAndMain.php +++ b/admin/code/LeftAndMain.php @@ -1413,7 +1413,11 @@ public function CMSVersion() { $cache = SS_Cache::factory('LeftAndMain_CMSVersion'); $cacheKey = filemtime($composerLockPath); $versions = $cache->load($cacheKey); - if(!$versions) $versions = array(); + if($versions) { + $versions = json_decode($versions, true); + } else { + $versions = array(); + } if(!$versions && $jsonData = file_get_contents($composerLockPath)) { $lockData = json_decode($jsonData); if($lockData && isset($lockData->packages)) { @@ -1429,7 +1433,7 @@ public function CMSVersion() { } } } - + // Fall back to static version file foreach($modules as $moduleName => $moduleSpec) { if(!isset($versions[$moduleName])) {