Development

#3417 (Retrieving an old object version doesn't always work for related resources)

You must first sign up to be able to contribute.

Ticket #3417 (new defect)

Opened 2 months ago

Last modified 2 months ago

Retrieving an old object version doesn't always work for related resources

Reported by: dcaravana Assigned to: trivoallan
Priority: major Milestone:
Component: sfPropelVersionableBehaviorPlugin Version: 1.0.13
Keywords: Cc:
Qualification: Unreviewed

Description

When you try to get an old version of a resource, the many-to-many relation data gets overwritted by the same data from the latest version: this happens, for example, when you use the admin_double_list.

After some digging, I found that the problem is that populateResourceFromVersion() calls the getXtoYs() method, instead the admin_double_list calls the getXtoYsJoinY() method: the latter reloads data from the database because the current Criteria instance is different from the latest one, and this is because the latest got some select colums set by getXtoYs() method through a call to XtoYPeer::addSelectColumns().

My current workaround is an overload of the getXtoYs() method that clears the select columns from the latest criteria instance, but I'm not sure that this is the best fix because it could have some side effects that I do not know.

Change History

04/28/08 11:35:29 changed by FabianLange

  • milestone deleted.