[5.x] Fix wrong blueprint parent after revision publish #11116
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.