template encoding problem with collection fields
There are some encoding problems with collections fields ... especially when nested fields template have prop with json encoded value... (like editor-image :labels prop)
For instance, look at the popup opened in both screenshot :
a standalone "image field"
an "image field" within a collection. => you can spot the encoding problem
I started trace the bug, but I'm not sure how to resolve it ...
Some context : Collections field works by using a :templates prop :
<editor-collection
:existing-fields='{{ existing_fields }}'
:templates='{{ templated_fields }}'
:labels='{{ labels | json_encode }}'
:limit='{{ limit | json_encode }}'
:name="{{ field.name | json_encode }}"
:variant="{{ variant|json_encode }}"
></editor-collection>
templated_fields is a json encoded string
# macro.generate_collection_fields return an escaped json encoded string
{% set templated_fields %}{{ macro.generate_collection_fields(field, field.templates, record, true) }}{% endset %}
I guess this current bug is the same as the one mentioned here : to https://github.com/bolt/core/pull/3146
| Question | Answer |
|---|---|
| Relevant Bolt Version | 5.1.5 |
Sorry I was unclear while saying :
I guess this current bug is the same as the one mentioned here : to https://github.com/bolt/core/pull/3146
But fixing 3146 does not solve this bug. You should reopened it. What I would mean was "there is also an encoding problem here, and maybe solving this one (#3147) would solve #3146" and not the otherway around
Aha sorry for misunderstanding😅. I should really learn to read more carefully before closing issues...