spicywebau / craft-neo

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

[5.x] Child blocks disappearing/popping out of parent blocks, especially on cloned or copy/pasted blocks #964

Open TheFunkyMonk opened 2 weeks ago

TheFunkyMonk commented 2 weeks ago

Bug Description

We've had 3 separate clients report (as well as been experiencing a lot ourselves) child blocks disappearing or popping out of parent blocks recently, causing errors about blocks not being allowed at top level. Refreshing the entry and saving from there sometimes works, and running garbage collection on the server (per other issue recommendations) does help alleviate the issue for a while, but it keeps coming back. These aren't very complex Neo blocks and generally have only one child block, none with more than 1 level of nesting.

Glad to provide composer files/db backup if it's helpful, but it seems to be happening across the board enough at this point that hopefully it's easily reproducable.

Steps to reproduce

  1. Create a Neo block with a child block
  2. Add content
  3. Clone the block and attempt to save

Expected behaviour

Entry should save and child blocks should stay in parent containers

Neo version

5.2.15

Craft CMS version

5.4.10

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

nikolenko-dmitriy commented 1 week ago

Having the same trouble. Command ./craft gc/run helps indeed, but for a short period of time only

ttempleton commented 1 week ago

This seems similar to some of the behaviour from #957. Does your Craft project override Craft's autosaveDrafts general config setting?

nikolenko-dmitriy commented 1 week ago

This seems similar to some of the behaviour from #957. Does your Craft project override Craft's autosaveDrafts general config setting?

@ttempleton In mine project it's not overwritten, the default true value is used

ttempleton commented 4 days ago

Following the resolution of #961 it might be worth running one more gc/run and re-cloning the cloned blocks, and seeing if that resolves this issue as well.

IrateGod commented 4 days ago

Hi, just wanted to tag along and mention that I've been having the same issue on Craft 4, using Craft 4.9.7 and above, with Neo's version being 4.2.21.

ttempleton commented 3 days ago

If it's happening on Craft 4 as well, then this is probably unrelated to #961. If possible, could someone please send in their composer.json/lock files and database backup to plugins@spicyweb.com.au, along with information about an entry where this is reliably reproducible, and we'll have a look.