verbb / vizy

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

Vizy field is empty moving between environments #111

Closed anchovy closed 1 year ago

anchovy commented 2 years ago

Description We've got 4 developers working on a craft project and one is focusing on vizy and creating custom visy blocks - these are generating perfectly fine on the developers machine, but when another develop checks out the feature branch, runs $ composer install which triggers our post-install-cmd hook:

    "post-install-cmd": [
      "./craft migrate/all",
      "./craft project-config/apply",
      "./craft clear-caches/twigpack-manifest-cache",
      "./craft invalidate-tags/template"
    ]

The vizy blocks show up 'empty'? image

If I then go into the vizy field and set the 'tab' name and assign the correct field and save - the block content displays and there's no change to the generated config file - so it's as if the config file was totally ignored when ./craft project-config/apply was run?

Additional info

Additional context

tin-soldier commented 2 years ago

+1

engram-design commented 2 years ago

So looks like the block type settings for the field are missing, which should be being set when running ./craft project-config/apply.

A field layout is also generated for each block type, which aren't kept in the project config (no field layouts Craft-wide are), which would be the reason why it works when re-saving, but no config changes as made. It seems like the field layout isn't being created on project config apply.

I've tested this pretty thoroughly between sites, adding new block types, adding new fields, deleting - all seem to be synced correctly when applying the project config.

Were there any JS console errors when blocks were blank?

The blocks that are blank on the entries, I imagine they already exist as content on one developers site? What changes are being made by one developer to the Vizy field and/or block types?

If you can outline the steps to reproduce, I can look into it. Will keep trying on my end.

walshmichael commented 1 year ago

We have also noticed this occurring, over a number of websites.

For us it appears to happen when adding a field to an existing Vizy block within a Matrix field. The field can be new or existing, it does not seem to affect the outcome. If a new Vizy block is added to an existing Vizy field this does not seem to occur, only when modifying an existing one.

Project config certainly updates itself and includes the new field yaml and UUID entry as part of the project.yaml entry. The Matrix field config does add a new - elements entry which appears as expected (example below).

{ __assoc__: { 0: [type, craft\fieldlayoutelements\CustomField], 5: [required, false], 6: [width, 100], 7: [fieldUid, 6609c4c2-5526-4b77-8b82-769b71a523bb] } } # Field Name

Have experience this on various Craft CMS and Vizy plugin version combinations however the most recent occurrence was under the following environment versions;

Plugin version: 1.0.18 Craft version: Craft Pro 3.7.53.1

engram-design commented 1 year ago

I'm unable to reproduce this on my end, sorry. If you're actively experiencing this, let's see if we can get in touch via Discord or support@verbb.io as I may very well need to see your project config data, or your database for the site affected.