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

Blocks ejected out of containers on clone to new site, can't save entry #839

Closed
Christopholus opened this issue Feb 1, 2024 · 5 comments

Comments

@Christopholus
Copy link

Bug Description

We've been experiencing a few bugs when cloning entries on a multi-site setup. Primarily one bug which is that Neo blocks are sometimes immediately ejected from their containers on cloning, or when an entry is being saved.

Here is a video of the issue in action:
https://www.loom.com/share/4f5f26cacf3541a4973d5015fe46276c

In the video, I clone to a new site. Thankfully this time the blocks appear to be in their respective parents initially - but as soon as the entry is saved all of them are ejected out of their containers preventing the entry from being saved. It looks like many of them are also duplicated many times which causes the page to slow to a crawl.

Thank you in advance for any advice you can provide!

Steps to reproduce

  1. Create entry with neo blocks
  2. Ensure neo field is set to translatable
  3. Clone page into multi-site
  4. Try to save page

Expected behaviour

The plugin should maintain it's parent/child hierarchy on entry save, and should not create any duplicates of interior content

Neo version

4.0.3

Craft CMS version

4.7.1

What is the affected Neo field's propagation method?

Only save blocks to the site they were created in

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

This is not a templating issue

@Christopholus
Copy link
Author

Just following up with a similar issue that I feel is closely related so won't create another Github Issue for it but thought this might be helpful:

https://www.loom.com/share/169c5afdd077473694532405daa8644d

In this video I "clone" the entry to the new site, but save it without changing to that site. This allows the entry to save in both sites, but when I flip back to the entry in the other site all of the blocks are ejected again.

I think the issue might be the same in both videos, but one of the scenarios allows me to "bypass" the neo errors about the ejected blocks being at the wrong level.

@ttempleton
Copy link
Contributor

By any chance are you using 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.

If you are using Preparse Field, there have been some suggestions 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-field#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.

@ttempleton
Copy link
Contributor

Closing this issue for now and assuming Preparse Field is involved. Please let me know if you're not using it, though, and I'll reopen the issue.

@ttempleton ttempleton closed this as not planned Won't fix, can't repro, duplicate, stale Feb 25, 2024
@Christopholus
Copy link
Author

Sorry for the delay here @ttempleton - we ended up rolling back the plugin at the time and locking the versions as we were nearing launch of the project.

Unfortunately we are not using the Preparse plugin - though I wonder if another plugin may be conflicting with it. Any others you are aware of? I will give the new version of Neo a try at a later to test again and see if the issue persists. If so, perhaps we can look to revive this again to see if we can land on a fix!

@ttempleton
Copy link
Contributor

No worries @Christopholus - I can't think of any cases of this happening with other plugins, but if it happens again next time you try the new version, let me know and we'll reopen the issue.

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