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

Nesting Blocks disappear after saving. #927

Closed
DavidKabelitz opened this issue Aug 16, 2024 · 9 comments
Closed

Nesting Blocks disappear after saving. #927

DavidKabelitz opened this issue Aug 16, 2024 · 9 comments

Comments

@DavidKabelitz
Copy link

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
Copy link
Contributor

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.

@ttempleton ttempleton added bug report status: unconfirmed A bug report that has not yet been reproduced by the maintainer(s), and more information is required and removed bug report status: new labels Aug 17, 2024
@DavidKabelitz
Copy link
Author

@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
Copy link
Author

@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
Copy link
Contributor

If possible, could you please send your Composer files and database backup to [email protected], along with instructions for which entry this is happening with, and we'll have a look.

@DavidKabelitz
Copy link
Author

@ttempleton sure

@DavidKabelitz
Copy link
Author

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

@ttempleton
Copy link
Contributor

@DavidKabelitz I emailed you earlier today.

@ttempleton ttempleton added bug report status: confirmed A bug report that has been reproduced by the maintainer(s), but has not yet been fixed and removed bug report status: unconfirmed A bug report that has not yet been reproduced by the maintainer(s), and more information is required labels Sep 3, 2024
ttempleton added a commit that referenced this issue Sep 5, 2024
@ttempleton
Copy link
Contributor

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 verbb/hyper#189.

@DavidKabelitz
Copy link
Author

@ttempleton thx

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