verbb / vizy

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

Field content disappears when saving Vizy block with a TypedLinkField #236

Closed JshGrn closed 1 year ago

JshGrn commented 1 year ago

Describe the bug

When adding a block in Vizy with a field of a 'Link Field' (https://plugins.craftcms.com/typedlinkfield), when you save the page, the entire Vizy block containing the link field is discarded and saved as empty.

Steps to reproduce

  1. Install Typed Link field
  2. Create field 'Button' with default values
  3. Add Button field to Vizy
  4. Save a field with the button and content in
  5. Vizy field is now empty

Craft CMS version

4.4.15

Plugin version

2.1.6

Multi-site?

No

Additional context

This is a fresh install with minimal plugins, just using Super Table, Navigation, Vizy, Typed Link Field

engram-design commented 1 year ago

I'm wondering if you might be able to screen share this happening, as I can't seem to replicate it on my end. Here's a video of adding a link block, just in case I'm doing something wrong.

https://github.com/verbb/vizy/assets/1221575/41569619-0441-4455-94ab-b70543cdffc2

Are there any JS errors on the web developer tools console?

JshGrn commented 1 year ago

Hey, the video you took there is identical to me, but when I save the entire Vizy block is empty. No JS errors in the console.

The only difference in layout is

Vizy Field (vizyContent) -> Super Table (vizyColumnContent) -> Vizy Field (vizyContentElement)

Its a bit of a horrible structure but theres logic behind it - the first is for structure (columns) the second is the content that can go within columns and is repeatable super table (for extra columns) and the 3rd is one that wraps elements such as buttons, headings etc.

When I do exactly the same as your example, the last vizyContentElement field becomes empty, circled below. (if I add a link field here)

image

engram-design commented 1 year ago

Ah, I see - if you have Super Table in the mix with a nested field, that may complicate things a little. Looking into it.

JshGrn commented 1 year ago

@engram-design did you look at this one? This is a massive priority to me now as I can't roll this out like this due to risk of content loss... If its not going to be something that's likely to be resolved I will need to convert over to Neo which I don't want to do. This and the fields not initializing open issue are the two things driving me towards that as a solution.

engram-design commented 1 year ago

Fixed for the next release. To get this early, run composer require verbb/vizy:"dev-craft-4 as 2.1.7"

JshGrn commented 1 year ago

I did message you earlier on Discord but I should have just commented it here:

It is s fixed on the first occurrence of the nested fields, but if you then do exactly the same it goes again for the second onwards.

Vizy Content Area: Vizy -> SuperTable -> Vizy -> Link (Works) Vizy -> SuperTable -> Vizy -> Link (Content disappears)

engram-design commented 1 year ago

Okay, I think I've gotten to the bottom of these initializing issues by revamping how Vizy is loaded. There's been way too many edge-cases and weirdness for my liking! There's lots to deal with from nested Vizy fields, to the element slideout (quick-editing an entry) to this with Matrix/ST/Neo.

Have a double check on this running composer require verbb/vizy:"dev-craft-4 as 2.1.7"

engram-design commented 1 year ago

Fixed in 2.1.8