verbb / vizy

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

PHP Undefined index: type Error #18

Closed d-karstens closed 3 years ago

d-karstens commented 3 years ago

Description We've been trying out Vizy and it seems like a pretty great plugin to solve some headaches we've been having with content authoring 👌

Unfortunately we've been running into the following issue when saving re-saving an entry when using Vizy inside matrix or super table fields

Screen Shot 2021-05-12 at 3 41 38 pm

Screen Shot 2021-05-12 at 3 34 10 pm

I've done a little digging and it seems like this is potentially resolved just with a check for type before here, but I'm not sure if something else is going on with the error only happening if the entry has been saved once before

Love your work!

Additional info

Additional context

engram-design commented 3 years ago

Yep, this was caused by a Vizy field being nested in a Matrix field (or similar), and when saving the field containing un-changed block content. This is because Craft's delta-handling kicks in, which doesn't play nicely with how Vizy needs to work. Hence, only a tiny portion of the field data was being POST-ed back to Craft, causing this issue.

Fixed for the next release. To get the fix early, change your verbb/vizy requirement in composer.json to:

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

Then run composer update.

d-karstens commented 3 years ago

Thank you!

engram-design commented 3 years ago

Fixed in 1.0.2