This PR fixes an issue where after publishing a revision the parent set on the blueprint and field objects will still refer to the previous version of the entry.
This can cause issues during the preProcess calls fired by PublishedEntriesController::extractFromFields if you're using the parent. The issue we had is that we do something in preProcess that depends on the value of another field. We fetch the value of that field from the parent data, but if the parent is the previous version the value might be wrong.
The reason updating the parent isn't done just after clone (which would be the obvious place) is that the save calls further up in publishWorkingCopy/unpublishWorkingCopy can also result in the associated blueprint/parent objects getting out of sync, so the same issue persists, although I think that's unique to the eloquent driver.
This PR fixes an issue where after publishing a revision the
parent
set on the blueprint and field objects will still refer to the previous version of the entry.This can cause issues during the
preProcess
calls fired byPublishedEntriesController::extractFromFields
if you're using the parent. The issue we had is that we do something inpreProcess
that depends on the value of another field. We fetch the value of that field from the parent data, but if the parent is the previous version the value might be wrong.The reason updating the parent isn't done just after clone (which would be the obvious place) is that the
save
calls further up inpublishWorkingCopy
/unpublishWorkingCopy
can also result in the associated blueprint/parent objects getting out of sync, so the same issue persists, although I think that's unique to the eloquent driver.