Skip to content
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

Nested Blocks lost on craft resave/entries #812

Closed
denisyilmaz opened this issue Nov 10, 2023 · 3 comments
Closed

Nested Blocks lost on craft resave/entries #812

denisyilmaz opened this issue Nov 10, 2023 · 3 comments

Comments

@denisyilmaz
Copy link

Bug Description

When running craft resave/entries in the console the hierachy of neoblocks is lost and all children of a block are now on level 0.

Steps to reproduce

  1. create a neo block with one block on level 0 and subblocks as children
  2. create an entry where you use the block and several children
  3. run craft resave/entries
  4. check the entry again, the children are now on the same level as the parent block

Expected behaviour

No response

Neo version

3.9.8

Craft CMS version

4.5.10

What is the affected Neo field's propagation method?

No response

Does this issue involve templating, and if so, is eager-loading used?

This is not a templating issue

@ttempleton
Copy link
Contributor

I'm unable to reproduce this - but do you also use the Preparse Field plugin? That plugin is known to have caused loss of Neo block structure data, among other Neo content loss issues that have caused us to document Preparse Field as being incompatible with Neo.

@denisyilmaz
Copy link
Author

Thanks for bringing that limitation to my attention. We were not aware of that Preparse Field bug and it is actually what is causing the described problem as we use a "Anchor ID" preparse field on all our section blocks... hm, not taking more of your time, but do you, by any chance, have a alternative to preparse field that is compatible with neo?

@ttempleton
Copy link
Contributor

I forgot that there was some suggestion a while ago that issues with Preparse Field and Matrix fields could be resolved by cloning the block query given as the Matrix field value before using it (jalendport/craft-preparse#36), and that potentially this could resolve issues with Neo as well (#429 (comment)) - but those discussions involved Craft 3, and I'm unsure if it's still the case with Craft 4. I think it's worth trying, at least (and if you do try it and it works, please let me know, and I'll update the documentation to reflect that).

If you try the above and it doesn't work, are you able to share the Preparse field contents and I'll try to work out exactly how the block structure data is being lost?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants