New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change ObjectBuilder to reload related objects when collection is partia... #389
Conversation
Heya, thanks for this fix. It seems ok, but it's really weird that nobody reported it before.. Will try to investigate a bit more before to merge. |
Hi, I found a ticket from the old Propel trac that talks about the same issue http://trac.propelorm.org/ticket/1449 |
…ched with criteria
There is another BC issue. When fetching related objects with criteria, then any change to the related objects will not be saved when parent object is saved. $author = AuthorPeer::retrieveByPK(A1);
$c = new Criteria();
$c->add(BookPeer::ID, B1);
$books = $author->getBooks($c);
$books[0]->setTitle('Update to a book');
$author->save();
// will return true, because author didn't save the object
$books[0]->isModified(); |
…fetched with criteria
@willdurand I feel that I should squash f371602 and 9731032 but I'm not sure is it ok if its in a pull request. |
@CyExy na, it's ok |
Change ObjectBuilder to reload related objects when collection is partia...
Thanks! |
We are migrating from Propel 1.4 to 1.6 and have came up to some BC issues.
Given that Author (A1) has 2 Books: B1, B2
When instance pooling has been turned on it becomes even bigger issue, because code down the line would get the object with poisoned cache from the pool
There are other circumstances where this would happen, like when saving an
Book
object that has theAuthor
object loaded, for instance.If you find any issues with this fix please let me know, I'll try to address them.