verbb / vizy

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

Sanitize matrix field blocks and fields before assigning #51

Closed dyerc closed 3 years ago

dyerc commented 3 years ago

The issue I encountered in #49 was pretty awkward to get around short of deleting all of my entries containing the affected field. I'm sure this code will want cleaning up but the following code prevents the issue I was encountering from occurring (both on the frontend and the backend code editor).

Loading each field with fieldByHandle in src/elements/Block.php isn't a particularly elegant solution.

Hope it helps in merging a long-term fix.

engram-design commented 3 years ago

Thanks for this!