verbb / vizy

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

Vizy Block with PDF Asset breaks rendering #250

Closed BrandonJamesBorders closed 9 months ago

BrandonJamesBorders commented 10 months ago

Describe the bug

When a vizy block has an Asset field and a PDF is selected a JS error is thrown after saving or reloading the entry. This issue was introduced after I upgraded to Craft CMS 4.5 I believe.

The field renders properly if an image is selected.

Video: https://www.loom.com/share/0676377d22b5482f8986549239e07305

Steps to reproduce

  1. Create a Vizy block that has an Asset field that can accept PDFs
  2. Go to an entry and add the newly created block.
  3. Select a PDF
  4. Save the entry
  5. Observe that the field no longer shows and see an error in the console image

Craft CMS version

4.5.3

Plugin version

2.1.8

Multi-site?

NO

Additional context

No response

engram-design commented 10 months ago

Ugh, this is because Craft is starting to include more inline <style> tags around the place in 4.5.x. Vue is causing a fatal error here, because of the following:

<style type="text/css">
.bkcnixcaoe-st0{fill:hsl(212, 50%, 93%);}
.bkcnixcaoe-st1{fill:#FFFFFF;}
.bkcnixcaoe-st2{fill:hsl(210, 10%, 53%);}
</style>

Which is included in the SVG for the icon. It's a Craft issue - https://github.com/craftcms/cms/issues/13632

BrandonJamesBorders commented 10 months ago

Ah, thanks for the explanation, filing the bug report, and submitting a PR. Hopefully, it goes through quickly 🤞

BrandonJamesBorders commented 9 months ago

It was resolved with https://github.com/craftcms/cms/pull/13633 being merged. Thanks @engram-design!