Sign up ×
ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. It's 100% free, no registration required.

I've come across an issue where I've got a celltype which contains array data stored as a JSON string.

When I json_encode the array and return it on save_cell(), display_cell() then returns the JSON quote wrappers as entities?

What I expect:

[{"first_name":"Garret","last_name":"Winder"},{"first_name":"Jeff","last_name":"Claeson"},{"first_name":"Paul","last_name":"Burton"}]

What I get:

[{"first_name":"Garret","last_name":"Winder"},{"first_name":"Jeff","last_name":"Claeson"},{"first_name":"Paul","last_name":"Burton"}]

Is there any way I can disable this in Matrix? Presumably if I set the column formatting to 'none' somehow in the cell settings it'll resolve it - I couldn't see how to do that in the docs?

For now I'm just finding and replacing the " entities before decoding...

Thanks Iain

share|improve this question

1 Answer 1

The issue here seems to be that in Matrix 2.3 form_prep is called during the display_cell method:

Cell data is now run through form_prep(), just like normal field data

If you're outputting the input with form_textarea or form_input that also calls form_prep() leading to the double encoding.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.