Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major 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.

        Activity

        Mael Nison created issue -
        Hide
        Mael Nison added a comment -

        A try to import this file should fail.

        Show
        Mael Nison added a comment - A try to import this file should fail.
        Mael Nison made changes -
        Field Original Value New Value
        Attachment foobar.schema.json [ 10876 ]
        Hide
        Brian Fenton added a comment -

        I've submitted a pull request w/patch and unit test for this issue using the fix above. I had the same problem in my code on OS X 10.6.4, PHP 5.3.2

        Show
        Brian Fenton added a comment - I've submitted a pull request w/patch and unit test for this issue using the fix above. I had the same problem in my code on OS X 10.6.4, PHP 5.3.2

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DC-936, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Mael Nison
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: