I was assigning 2 slightly different criteria to 2 EMongoDocumentDataProviders but for some reason, the criteria of the second overwrote the criteria of the first. Because the getData of the DataProvider is run in the view (in a list widget). the results of the second criteria were shown instead of the first. This does not happen if the data is cached via getData before the second criteria is assigned to a dataprovider's constructor.
In the constructor of EMongoDocumentDataProvider:
$this->_criteria = $this->model->getDbCriteria();
If I change this to
$this->_criteria = new EMongoCriteria();
it works as it should.
How to replicate (change the conditions to fit your own model):
$a = new EMongoCriteria('conditions' => array('category' => 1);
$aProvider = new EMongoDocumentDataProvider('MyModel', array('criteria' => $a));
$b = new EMongoCriteria('conditions' => array('category' => 2);
$bProvider = new EMongoDocumentDataProvider('MyModel', array('criteria' => $b));
First var_dump shows $a criteria, second shows $b criteria, while it should show $a criteria.
Seems like the constructor and the fetchData of the EMongoDocumentDataProvider is really different from the standard implementation. Is it possible to unify it a bit? That would probably get rid of this problem. I hacked around it, but without proper unit tests and am not certain it'll hold up in all cases.