Repository navigation
[5.x] Fix wrong blueprint parent after revision publish - #11116
Conversation
|
@jacksleight Is there a test that you provide or perhaps an example of how I could reproduce this issue? This PR has caused an issue where the stache is taking a very long time to warm, see #11189. |
|
@simonworkhouse I don't have a specific test no, this was an issue we were having in an addon that depends on the field parent data (as described above). @jasonvarga If this is affecting stache performance perhaps the changes to |
…ng copy Guards the behavior from statamic#11116 now that setParent() can keep the cached fields. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This PR fixes an issue where after publishing a revision the
parentset on the blueprint and field objects will still refer to the previous version of the entry.This can cause issues during the
preProcesscalls fired byPublishedEntriesController::extractFromFieldsif you're using the parent. The issue we had is that we do something inpreProcessthat 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
savecalls further up inpublishWorkingCopy/unpublishWorkingCopycan 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.