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

Vizy not working in Neo v3.9 #260

Open
stevendierick opened this issue Sep 24, 2023 · 5 comments
Open

Vizy not working in Neo v3.9 #260

stevendierick opened this issue Sep 24, 2023 · 5 comments

Comments

@stevendierick
Copy link

Describe the bug

Vizy in a Neo block won't initialize anymore since the new Neo v3.9 updates. Works perfectly fine on Neo v3.8.6.

Tested with parent and child blocks:

Steps to reproduce

  1. Add Vizy field to Neo block
  2. Add your Neo block with Vizy to your page

Craft CMS version

4.5.5

Plugin version

2.1.9

Multi-site?

No

Additional context

Neo plugin version: 3.9.2

@engram-design
Copy link
Member

engram-design commented Sep 24, 2023

Judging from the error message, this seems a Neo issue?

image

I can confirm the check here fails.

@ttempleton
Copy link

If I'm understanding the purpose of _isRootField() correctly (making sure the element doesn't exist inside a Vizy block), then the recursive call with the Neo block's owner is unnecessary since Neo fields are disallowed from being nested in other block element fields.

@engram-design
Copy link
Member

Hmm, you make a good point! This function is there for complicated reasons with Vizy to check if it's a nested Vizy field, but to handle complex situations like Vizy > Neo > Vizy > Neo > etc. So there is a use-case for us to travel up the element "tree" to see how the structure is.

From what I can tell with Neo, this seems to be because we're calling things early before the parent element has time to be populated. Looking into what I can do on my end about this.

@ttempleton
Copy link

The underlying change in Neo 3.9 is that the first creation of a block of a given type will now lazy load the block type's field layout tabs, rather than having it all loaded on page load when many block types may not be used. This involves creating a new Neo block instance of that type to then render its tabs, and it turned out that we weren't passing through the owner ID, which caused this error. I've added the fix spicywebau/craft-neo@afc6b45 which will be included in the next release.

@engram-design
Copy link
Member

Nice, thanks @ttempleton !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants