spicywebau / craft-neo

A Matrix-like field type for Craft CMS that uses existing fields
Other
402 stars 63 forks source link

Nesting Blocks disappear after saving. #927

Closed DavidKabelitz closed 2 months ago

DavidKabelitz commented 2 months ago

Bug Description

Since Craft 5 we have many problems with nested neo blocks. We created a web builder with different levels of neo blocks (up to three). At the moment with every page reload the entry displays unsaved changes even without changing anything. Sometimes Child block appear at the top level after saving and causing errors, at very long pages the risk is high to edit those... Also copy or cloning a section with some nested blocks usually is always a problem. Save after, does not work. Also at many pages we are even not able to delete blocks or edit text, autosave and preview works, after save all changed sections with childs are just gone.

Steps to reproduce

No idea, need to share our setup

Expected behaviour

No response

Neo version

5.2.0

Craft CMS version

5.3.4

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 commented 2 months ago

By any chance are you using the Preparse Field plugin? That plugin has been known to cause loss of block nesting / loss of blocks entirely.

DavidKabelitz commented 2 months ago

@ttempleton Preparse Field plugin? Nope, never heard of it ;)

Thats in use: "craftcms/ckeditor": "4.2.0", "craftcms/cms": "5.3.4", "leowebguy/device-detect": "3.0.0", "nystudio107/craft-imageoptimize": "5.0.2", "nystudio107/craft-minify": "5.0.0", "nystudio107/craft-retour": "5.0.2", "nystudio107/craft-seomatic": "5.1.2", "nystudio107/craft-typogrify": "5.0.1", "ostark/craft-async-queue": "4.0.0", "putyourlightson/craft-blitz": "5.6.4", "spicyweb/craft-neo": "5.2.0", "studioespresso/craft-mailersend": "5.0.0", "vaersaagod/dospaces": "3.0.0", "verbb/formie": "3.0.3", "verbb/hyper": "2.0.4", "verbb/navigation": "3.0.3",

DavidKabelitz commented 2 months ago

@ttempleton i created a screen recording, if you are interested...also while doing it i found an interesting new "issue"...somehow while saving on of the block is duplicated and out or order...it's alway a copy of the old child block because change. Also in the video you can see, the entry loops for ever in those "unsaved changes" mode

ttempleton commented 2 months ago

If possible, could you please send your Composer files and database backup to plugins@spicyweb.com.au, along with instructions for which entry this is happening with, and we'll have a look.

DavidKabelitz commented 2 months ago

@ttempleton sure

DavidKabelitz commented 2 months ago

@ttempleton any update here? Cause we also have problems at other projects...and it's not usable anymore

ttempleton commented 2 months ago

@DavidKabelitz I emailed you earlier today.

ttempleton commented 2 months ago

It turned out that the misplaced blocks and related errors were caused by some leftover element owner data for blocks, that didn't have any structure data associated with the block for that owner. I'm a bit concerned about how that happened - hoping it was an old bug that's just caused some after-effects - but I've added some code to run during Craft garbage collection to clear that out. So updating to 5.2.4 and running php craft gc/run should resolve that. I'm going to close the issue for now, but please let me know if it happens again in the future and I'll reopen.

As a side note, the instant display of unsaved changes for the entry is being caused by nested Hyper fields, likely the same bug as https://github.com/verbb/hyper/issues/189.

DavidKabelitz commented 2 months ago

@ttempleton thx