Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.2.3
-
Fix Version/s: None
-
Component/s: File Parser
-
Labels:None
-
Environment:PHP 5.3.3-1ubuntu9.1
Description
With a valid Json file :
PHP Warning: explode() expects parameter 2 to be string, object given in Doctrine/Doctrine/Import/Schema.php on line 381
PHP Catchable fatal error: Object of class stdClass could not be converted to string in Doctrine/Doctrine/Import/Schema.php on line 391
It's due to this line, line, in Doctrine/Parser/Json.php (#65) :
$json = json_decode($contents);
It should be:
$json = json_decode($contents, true);
Because casting the result as array will only affect the top-level element. You must use the second parameter of json_decode() to force every objects (including sub-objects) to be converted to indexed arrays.
A try to import this file should fail.