verbb / vizy

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

[Craft 4.x]: Images with id string in attributes failing to render #293

Closed anita-chouhan closed 7 months ago

anita-chouhan commented 7 months ago

Describe the bug

We recently upgraded our Craft CMS version to 4.7.2 from 3.8.17. We are using a vizy field in the project and found that some of the entries having an image inside the rich text are failing to render. The error is showing as:

Screenshot 2024-03-29 at 3 12 27 PM

Steps to reproduce

  1. Setup a Craft CMS version 3.8.17 with a vizy field Field Settings:
    • Editor Config: Default
    • Editor Mode: Blocks & Rich Text
    • Remove Empty Paragraphs: True
    • Plain Text Paste: False
    • Block Type Picker Behaviour: Click
  2. Add some entries with images and text.
  3. Upgrade the Craft CMS version to 4.7.2

Craft CMS version

4.7.2

Plugin version

2.1.17

Multi-site?

No

Additional context

We observed that the issue is resolved if:

We compared the database output of both the working and non-working versions of the entries and found that the non-working version has an Id parameter inside the attrs array which is absent in the working version of the entry.

Working Version

Screenshot 2024-03-29 at 2 21 00 PM

Non-working Version

Screenshot 2024-03-29 at 2 21 11 PM
engram-design commented 7 months ago

Hmmm, it seems strange that the embed115 ID was there as an attribute, that shouldn't have been possible. But, I can certainly add handling for that.

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

anita-chouhan commented 7 months ago

@engram-design Thank you for providing the fix. The entries are loading fine now after updating the plugin.