-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Resave newly fetched version of element in EVENT_AFTER_SAVE_ELEMENT #66
Conversation
@jalendport @rjhewitt3 Hi folks, happy new year. I was hoping that one of you could take a look at this in the near future, as I have a feeling it could be effecting quite a few people without them really realising it. And more so as adoption of the latest Craft version picks up in January. I'd be very appreciative to hear any feedback. Thanks. |
@jalendport - We just ran into a similar issue with this on the Annotated Notes plugins which caused serious content problems for our client. We have this plugin installed and haven't seen this issue popup, but we'd definitely feel much better if this PR could be merged sooner than later. What are you thinking, good sir? |
@jalendport @monachilada's fork fixed the issue that I was seeing with Neo blocks being destroyed upon re-save 👍 For anyone following this, until this gets merged, you can patch it by using @monachilada's fork by doing the following:
"repositories": [
{
"type": "vcs",
"url": "https://github.com/monachilada/craft-preparse-field"
}
],
Before"besteadfast/craft-preparse-field": "1.x.x" After"besteadfast/craft-preparse-field": "dev-develop" |
@monachilada thanks for the PR! Thanks everyone else for your patience; I’ve got some time set aside tomorrow afternoon to test ‘er out and then I’ll merge and cut a new release for y’all. |
Hey @jalendport! How'd that testing go? 😉 |
Thanks @jalendport! 🎉 |
Thanks @jalendport |
About time! Haha. I mean, thanks @jalendport! 😜 |
Further fixes for #64 and potentially also #62
The fix @brandonkelly submitted here worked for elements that already existed, but some funky behaviour stripping matrix fields still occurred the first time an element was created.
This PR attempts to fix that, by ensuring that the element being resaved in the
EVENT_AFTER_SAVE_ELEMENT
is a freshly fetched version of itself, rather than the version of the element that was passed through the event. This way, matrix references appear to correctly match up and thus are correctly saved alongside the preparse data that is generated.Also some minor formatting occurred, sorry that the diff is a little difficult to follow.