Doctrine MongoDB ODM
  1. Doctrine MongoDB ODM
  2. MODM-63

More errors when persisting gridfs files

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0BETA2
    • Component/s: Persister
    • Labels:
      None

      Description

      Getting following errors when trying to persist GridFS file.

      Trying to get property of non-object in file Doctrine\ODM\MongoDB\MongoCollection.php on line 196 
      Undefined index: _id in file Doctrine\ODM\MongoDB\Persisters\BasicDocumentPersister.php on line 163 
      

      Unfortunately couldn't create reproducable test-case yet, but if that is not an obvious issue, please let me know, I'll try to dig deeper and get the test case.

        Activity

        Vladimir Razuvaev created issue -
        Hide
        Jonathan H. Wage added a comment -

        We'll need a test case, always. Or atleast some kind of pasted code that I can use to produce the issue.

        Show
        Jonathan H. Wage added a comment - We'll need a test case, always. Or atleast some kind of pasted code that I can use to produce the issue.
        Hide
        Jonathan H. Wage added a comment -

        Can you just paste the code that causes the error? Like you have done in previous issues. I can't seem to replicate this one.

        Show
        Jonathan H. Wage added a comment - Can you just paste the code that causes the error? Like you have done in previous issues. I can't seem to replicate this one.
        Hide
        Vladimir Razuvaev added a comment -

        I've found a case when it happens. It is an exceptional situation when someone is trying to persist file without property $file being set.

        E.g. the case:

        /** @Document(db="tests", collection="fs") */
        class a
        {
            /** @Id */
            protected $id;
        
            /** @File */
            protected $file; // note, file is not set
        
            /** @String */
            protected $c = 'tmp';
        }
        
        $a = new a();
        $dm->persist($a);
        $dm->flush();
        

        This test case produces notices and warnings. My guess is that it should end up with Exception?

        Show
        Vladimir Razuvaev added a comment - I've found a case when it happens. It is an exceptional situation when someone is trying to persist file without property $file being set. E.g. the case: /** @Document(db= "tests" , collection= "fs" ) */ class a { /** @Id */ protected $id; /** @File */ protected $file; // note, file is not set /** @ String */ protected $c = 'tmp'; } $a = new a(); $dm->persist($a); $dm->flush(); This test case produces notices and warnings. My guess is that it should end up with Exception?
        Hide
        Jonathan H. Wage added a comment -

        This should be fixed now.

        Show
        Jonathan H. Wage added a comment - This should be fixed now.
        Jonathan H. Wage made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Jonathan H. Wage made changes -
        Fix Version/s 1.0.0BETA2 [ 10092 ]

        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=MODM-63, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Vladimir Razuvaev
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: