verbb / vizy

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

Conditions on entry queries on matrix fields inside Vizy blocks don't work #309

Open rmales opened 2 months ago

rmales commented 2 months ago

Describe the bug

I'm trying to use a basic entry query field condition on a matrix field inside a Vizy block, but I cannot get it to work. Looking at the SQL query that gets run the field condition is being applied to the elements_sites table rows, but the matrix field entries don't exist there, they seem to only exist inside the content column JSON. I'm not familiar with how content is stored in Craft 5 (and our setup is fairly complex) so I'm not sure if this is a bug or something we've messed up.

Steps to reproduce

  1. Add a matrix field inside a Vizy block
  2. Try to apply a condition to the matrix field entry query in a template

Craft CMS version

5.3.6

Plugin version

3.0.3

Multi-site?

No

Additional context

No response

engram-design commented 2 months ago

Right, so we may have our work cut out for us on this front, as Vizy stores its content as a JSON blob, just like Craft stores content for elements as a JSON blob (this is despite Vizy content not being an element). So we may need to provide some handling here. It's also potentially something that might not be possible due to Matrix content inside Vizy content not truly being elements.

Out of interest, what's your query with conditions look like?