diff --git a/php/classes/AmdaAction.php b/php/classes/AmdaAction.php index b6fd25d..0119ba2 100644 --- a/php/classes/AmdaAction.php +++ b/php/classes/AmdaAction.php @@ -1762,17 +1762,17 @@ class AmdaAction $childrenToReturn = array(); $children = []; if (!file_exists(DATAPATH.'defaultValues.json')) - return array('success' => false , 'defaultValues' => array(), 'message'=>'efaultvalues file not found.'); + return array('success' => false , 'defaultValues' => array(), 'message'=>'Defaultvalues file not found.'); $json_o = json_decode(file_get_contents(DATAPATH.'defaultValues.json'), true); if (empty($json_o)) return array('success' => false , 'defaultValues' => array(), 'message'=>'Error : defaultValues file empty.'); - if (!file_exists(USERDIR.'userDefaults.json')) - return array('success' => true , 'defaultValues' => $json_o, 'message'=>'No modification on defaultvalues.'); - - $json_user = json_decode(file_get_contents(USERDIR.'userDefaults.json'), true); - if (empty($json_user)) - return array('success' => true , 'defaultValues' => $json_o, 'message'=>'No modification on defaultvalues.'); + $json_user = array(); + if (file_exists(USERDIR.'userDefaults.json')) + $json_user = json_decode(file_get_contents(USERDIR.'userDefaults.json'), true); + if (empty($json_user)) { + $json_user = array(); + } foreach($json_user as $key => $value){ $keys = explode(".", $key); -- libgit2 0.21.2