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

Child blocks are mixed up on save #745

Closed
Sjouwke opened this issue May 25, 2023 · 6 comments
Closed

Child blocks are mixed up on save #745

Sjouwke opened this issue May 25, 2023 · 6 comments

Comments

@Sjouwke
Copy link

Sjouwke commented May 25, 2023

Bug Description

Child blocks are mixed up on save. For example:

  • Top level block Split can only have 1 child of type Image or Video
  • Top level block Cards can only have child blocks of type Card
  • Top level block Testimonials can only have child blocks of Testimonials.
    Suddenly, sub blocks are mixed up. Split block now has 3 children of different types. Testimonials are added to cards. Cards bock only has 1 child, of type testimonial.
    This happens on multiple pages.

Steps to reproduce

  1. Save page
  2. Open page again
  3. Sub blocks are mixed up

Expected behaviour

No response

Neo version

3.7.8

Craft CMS version

4.4.10.1

What is the affected Neo field's propagation method?

Save blocks to all sites the owner element is saved in

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

This is not a templating issue

@ttempleton
Copy link
Contributor

If possible, could you please send a database backup and your composer.json/lock files to plugins@spicyweb.com.au, along with an example of an entry that has this issue, and we'll have a look.

@ttempleton
Copy link
Contributor

Thanks for sending those @Sjouwke. Unfortunately I haven't been able to reproduce the behaviour yet, but I've seen evidence of it having happened in the entry revisions. At this point I think it might be caused by the issue described in #708 (comment) / #717 where old block structure data from provisional drafts wasn't being cleared out. Newer Neo releases (>= 3.6.3) clear that data out as part of Craft's garbage collection if any still exists - could you please run php craft gc/run and let me know if the issue still occurs?

@Tim-Wils
Copy link

@ttempleton @Sjouwke Maybe related? craftcms/cms#13256

@ttempleton
Copy link
Contributor

@Tim-Wils There have been long-term issues with Preparse Field and Neo compatibility (see jalendport/craft-preparse-field#30, #398 and many other issues linked to that one) to the point that we listed Preparse Field in the plugin incompatibility list for the Craft 3 version of Neo. I'd removed it from that list for the Craft 4 version, and hadn't heard of any issues between the two plugins on Craft 4 until now - but if there are still issues on the Preparse Field end, I'll need to add it back to the list. (Of course, if any issues turn out to be caused by Neo, we'll look into a fix for them.)

@Sjouwke
Copy link
Author

Sjouwke commented May 31, 2023

Hey @ttempleton, thanks for having a look. I've ran php craft gc/run and also did a small update today, but it happened again. This time, some of the child blocks now also appear as top level blocks as wel.

@ttempleton
Copy link
Contributor

This turned out to be related to merging of live entry content into draft content, where newly-created blocks from the live entry could get merged into the wrong place in the draft block structure. The fix for that will be included in the next release, which will hopefully be after #746 is resolved. In the meantime, you can get that fix by setting your composer.json file's spicyweb/craft-neo requirement to 3.x-dev as 3.7.9 and running composer update.

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

3 participants