Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

template encoding problem with collection fields #3147

Open
dadaxr opened this issue Mar 28, 2022 · 2 comments
Open

template encoding problem with collection fields #3147

dadaxr opened this issue Mar 28, 2022 · 2 comments

Comments

@dadaxr
Copy link
Contributor

dadaxr commented Mar 28, 2022

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 :

Screenshot from 2022-03-29 00-26-27
a standalone "image field"

Screenshot from 2022-03-29 00-26-41
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 #3146

Question Answer
Relevant Bolt Version 5.1.5
@dadaxr
Copy link
Contributor Author

dadaxr commented Mar 30, 2022

Sorry I was unclear while saying :

I guess this current bug is the same as the one mentioned here : to #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

@Joossensei
Copy link
Contributor

Aha sorry for misunderstanding😅. I should really learn to read more carefully before closing issues...

@Joossensei Joossensei reopened this Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants