[MODM-63] More errors when persisting gridfs files Created: 28/Aug/10  Updated: 24/Nov/10  Resolved: 24/Nov/10

Status: Resolved
Project: Doctrine MongoDB ODM
Component/s: Persister
Affects Version/s: None
Fix Version/s: 1.0.0BETA2

Type: Bug Priority: Major
Reporter: Vladimir Razuvaev Assignee: Jonathan H. Wage
Resolution: Fixed Votes: 0
Labels: None


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.

Comment by Jonathan H. Wage [ 30/Aug/10 ]

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

Comment by Jonathan H. Wage [ 30/Aug/10 ]

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.

Comment by Vladimir Razuvaev [ 31/Aug/10 ]

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();

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

Comment by Jonathan H. Wage [ 24/Nov/10 ]

This should be fixed now.

Generated at Tue Dec 01 11:38:53 EST 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.