verbb / vizy

A flexible visual editor for Craft CMS
Other
44 stars 8 forks source link

Vizy inside blocks show blocks from parent element #156

Closed bsleys closed 1 year ago

bsleys commented 2 years ago

Description I have a Vizy field with blocks, some of those blocks also have a Vizy field. The Vizy field inside the block shows the blocks defined at the top Vizy field and not their own blocks, or lack of blocks. In my case I don't want the vizzy field in the block to have any blocks.

Steps to reproduce

  1. Create a Field of type matrix
  2. Add a Vizy type field and define some blocks.
  3. Add a Vizy type filed to one of the fields used a block in above but don't add any blocks to it.
  4. When used to add content the blocks defined in step 2 show up in the vizy filed in step 3

Additional info

Additional context

engram-design commented 2 years ago

Are you able to provide a screenshot (or recording) of your setup? That's certainly not the case for me and my testing, but potentially there's something unique about your setup, field handles, etc.

bsleys commented 2 years ago

I think I found the problem. If the vizy field has the same handle as the parent vizy field the blocks are shown in the child. if they are different handles than they don't show.

On another note if I do add blocks to vizy filed that is used part of a block, setting all vizy fields to unique handles, when I edit the content I can add the sub block to the vizy field but when saving the entire bloc is lost.

Structure: Field: page Content - type matrix --> vizy field - handle - text -----> block in "text" field - Tiles - type martix ----------> vizy field - handle - contentText --------------> block in "contentText" - tabs - type matrix ----> block in "text field - tabs - type matrix

So if the above structure all is fine adding the blocks tabs and Tiles to the vizy field "text". But if I add the block tabs to the vizy field "contentText", which is part of Tiles and save the entire Tiles block data is lost.

Hope that makes sense.

Bob

engram-design commented 2 years ago

So firstly, can you send through a screenshot of fields? It's a little complicated and I couldn't quite follow your setup (sorry!)

As for the second part, can you try the latest fix? To get the fix early, change your verbb/vizy requirement in composer.json to:

"require": {
  "verbb/vizy": "dev-craft-3 as 1.0.15",
  "...": "..."
}

Then run composer update.

FransvdWijst commented 2 years ago

We also encounterd similar problems with Nested Vizy components.

When saving an entry with nested vizy components, the nested vizy component was saved without any content.

When saving again with content it saves correctly. This only occurs on the first save of a new nested vizy component.

I decided to test the fix for the next release. It looks like this fix works here!

engram-design commented 2 years ago

Fixed in 1.0.16

bsleys commented 2 years ago

Still not working for me or I'm doing something wrong. Below is a screen cap vid of my fields.

https://drive.google.com/file/d/1-5DF78XeM3XC4IHGIcBXQCuXsalfSCkl/view?usp=sharing

bsleys commented 2 years ago

I've upgraded to craft 4 and current version of vizy but this problem still remains. Is this something that should work? Am I doing something wrong or is this just a bug we need to wait till fixed if possible?

engram-design commented 1 year ago

Can you confirm what version you're on now? There were some issues with this and nested Vizy fields, but these should've been resolved in the last few versions (for both Craft 4 and 3)

bsleys commented 1 year ago

I just checked again and I was indeed a version behind. Updated to latest 2.0.7 and it does appear to be working. Thanks again