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

Double entity encoding when rendering events in admin #1

Open
netcarver opened this issue Apr 17, 2014 · 1 comment
Open

Double entity encoding when rendering events in admin #1

netcarver opened this issue Apr 17, 2014 · 1 comment

Comments

@netcarver
Copy link

@ryancramerdesign

Thanks for this module - it's serving as a really useful example for me at the moment. However, as reported here by Valery, the output does seem to get double entity encoded when displayed in the containing PW page.

I can only guess that the containing page (or fieldset) is entity encoding the string from Event.php#96.

Whilst forcing output formatting on (line 95) does cause the event's fields to be entity encoded, the entire output including html markup in line 96 seems to be encoded later leading to it not displaying as desired and with double encoding of values from the fields. For example...

fieldtypeevents

@pine3ree
Copy link

pine3ree commented May 10, 2021

Hello @netcarver,

when I create Fieldtypes with multiple subfields I always html-escape their string values and I usually add a method getUnformatted($key) for retrieving the unformatted values.

Another option would be to make the value object (Event in this case) implement PageFieldValueInterface, but then you would have to manage the internal formatted status. When fetching the internal subfields (::get($key)) you would have to check for the formatted status and format (or not) the requested value accordingly.

kind regards

PS
I then use the getUnformatted($key) when populating the inputfields...

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