Open stevendierick opened 9 months ago
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.
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.
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 https://github.com/spicywebau/craft-neo/commit/afc6b45f6dfc364c6d2249a5bbece47e77b3088d which will be included in the next release.
Nice, thanks @ttempleton !
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
Craft CMS version
4.5.5
Plugin version
2.1.9
Multi-site?
No
Additional context
Neo plugin version: 3.9.2