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 9cc8c5364..b1c47f26f 100644 --- a/admin/code/LeftAndMain.php +++ b/admin/code/LeftAndMain.php @@ -1413,7 +1413,11 @@ class LeftAndMain extends Controller implements PermissionProvider { $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 @@ class LeftAndMain extends Controller implements PermissionProvider { } } } - + // Fall back to static version file foreach($modules as $moduleName => $moduleSpec) { if(!isset($versions[$moduleName])) {