verbb / vizy

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

Nested Fields Don't Appear to Save #11

Closed DynamiteGoesBoom closed 3 years ago

DynamiteGoesBoom commented 3 years ago

For some fields like:

Vizy doesn't seem to want to save the data.

Steps to reproduce

  1. Install Vizy
  2. Create a Vizy Field called vizyBuilder
  3. Setup fields like so: Screen Shot 2021-05-05 at 6 52 56 PM
  4. Within vizy/blocks/alternator I have
    <pre>
    {{ dump(imagePosition) }}
    </pre>
    {% exit %}

    and it keeps returning as NULL.

  5. In the entry that I have vizyBuilder attached I have this showing the imagePosition (which has right set as the default position in the field settings) field: Screen Shot 2021-05-05 at 6 55 34 PM

but upon saving the entry (after choosing left for the position) the value of imagePosition reverts back to the default value (right) and returns null.

I mentioned colour swatches too as the same thing happening to position is happening with that plugin. Initially I thought that issue could have been related to that plugin directly, so I setup an issue, only to close it until further testing could be completed.

Anyway, I love this plugin already and hoping this issues can be resolved one way or another.

Thanks again and I've been a huge fan of all of your amazing plugins and Vizy will soon be my favorite one yet!

Additional info

huelabs commented 3 years ago

I agree, I'm seeing the same thing with a Tag field: https://files.huelabs.com/wl/?id=yOpE0wzLVOukd4pp06VV8jfJIuUQKhT2

adrienne commented 3 years ago

I'm having a similar/related issue with Asset fields. If you use the modal dialog for uploading everything is fine, but if you use the Upload A File button, it uploads the image but doesn't save it properly to the entry.

image

DynamiteGoesBoom commented 3 years ago

I'm not sure if this is related to this issue exactly, but I am also not able to set Formatting of text and getting an error in the console when trying to assign the text as an h2:

Screen Shot 2021-05-06 at 12 24 13 PM

It looks like @adrienne already mentioned this issue regarding Redactor fields, but it's also happening with Vizy itself.

engram-design commented 3 years ago

Just for future reference here, we're doing some crazy stuff with the fields in Vizy blocks. What each block needs to do is serialize the content of all fields within the block. This is, in practice, tricky with Vizy being in Vue, and fields being in jQuery (Craft core fields, and any other third-party fields).

So, we need a mechanism to detect when a field changes, and then trigger serialization of the block form inputs to JSON so Vizy can save that.

So there's going to be some edge-cases. I haven't tested position or colour swatches, so there's likely some issues there with change-detection. However all core Craft fields should work.

@huelabs will double check tags, I did have a bit of trouble with that due to how that field works.

@adrienne I'll look at the upload button for assets, I'll admit I didn't test the Upload button, only the asset selection.

@DynamiteGoesBoom your last issue is unrelated it seems. I'll look into it.

engram-design commented 3 years ago

All items should be fixed in 1.0.1