Skip Navigation

[Resolved] Special Characters in Layouts Custom Cell

This support ticket is created 6 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 3 replies, has 2 voices.

Last updated by Joe 5 years ago.

Assisted by: Beda.

Author
Posts
#957260

Joe
grad-req-back-end.png
grad-req-front-end.png

I am trying to:
I have a couple custom cells for displaying data in different formats. There is a text area in one of the custom cells that accepts any text. If a user enters a special character like an apostrophe (') or ampersand (&), it is translated to its HTML hexadeciml special character code when pulled from the database. However, the next time a user edits the text, the code is re-translated because it has an ampersand in it. So, ' - the code for apostrophe - becomes ' - because the & in the special character is also translated into a character code.

Link to a page where the issue can be seen:
hidden link

I expected to see:
In the Degree Grad Requirements box, the text should read "Learn about UD's academic requirements for graduation. "

Instead, I got:
The box instead reads: "Learn about UD's academic requirements for graduation. "

Note that we are using IIS to serve the site.

Here is PHP snippet that creates the box in the custom cell:

    <li>
        <label for="<?php the_ddl_name_attr('oet_polaroid_text'); ?>"><?php _e('Description', 'ddl-layouts') ?>:</label>
        <textarea id="oet_polaroid_text" cols="80" name="<?php the_ddl_name_attr('oet_polaroid_text'); ?>"></textarea>
    </li>
#957900

I can see with the example we provide here the same issue:
https://toolset.com/documentation/programmer-reference/layouts-cells-api/

I think this is due to how the inputs are registered.
I see some differences for example from the Caption of a slider (translatable) to the one in the DOC, which is not, and throws that unexpected encoded value.

I reported this issue and we will see to update the DOC and/or fix Layouts in regard.

For now I did not find a proper solution but I think it should be possible to intercept and work with htmlentities() and html_entity_decode().
But I did not try this.

I'll feedback here when I have news about this.

#1404257

This results as resolved now

Please let me know if it is solved for you as well using the latest Toolset release you can find in your account:
toolset.com/accounts/download

You can also find the updates in the plugins area in the Commercial tab, after eventually clicking once "check for updates".

Thanks!

#1406945

Joe

My issue is resolved now. Thank you!