Problem with Neo draft behavior #925
Labels
bug report status: unconfirmed
A bug report that has not yet been reproduced by the maintainer(s), and more information is required
bug report
Bug Description
Hello, I know that my request is somewhat vague. But unfortunately I have not yet been able to localise the error more precisely. There is a customised plugin that drafts a page including all content elements and then translates all the fields. An event is triggered for each field, via which the field receives its translation data if necessary. This used to work smoothly, but no longer does (without knowing me the time since it fails).
The point is, all standard craft fields on the page are still changed correctly and saved in the draft only. However, for all fields that are within a Neo structure, the translation is saved in both the draft and the regular entry. In this case, it seems as if no draft version of the Neo structure was created at all.
Is there a difference in what happens with a Neo field when a draft version is created in code with
Craft::$app->drafts->createDraft($entry, ...);
and then afterwards (after the translation) is saved via
Craft::$app->getElements()->saveElement($element, false, false);
Or perhaps you have another idea that could explain the different behaviour?
By the way, if I create a draft in the Craft BE everything works out as expected.
Steps to reproduce
Sorry, as that is a custom plugin there is no chance for you to reproduce it.
Expected behaviour
No response
Neo version
4.1.3
Craft CMS version
4.9.5
What is the affected Neo field's propagation method?
Only save blocks to the site they were created in
Does this issue involve templating, and if so, is eager-loading used?
This is not a templating issue
The text was updated successfully, but these errors were encountered: