Skip Navigation

[Resolved] Can't stop characters from getting encoded

This thread is resolved. Here is a description of the problem and solution.

Problem:
The customer reported that the single quote characters in the classic views editor are getting converted to their equivalent ASCII character.

Solution:
Guided that this only happens when the option "Disable the visual editor when writing" is checked on the user profile page.
( WP Admin -> Users -> Profile )

Relevant Documentation:
n/a

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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 13 replies, has 2 voices.

Last updated by rusty 1 year, 8 months ago.

Assisted by: Waqar.

Author
Posts
#2420251
Screen Shot 2022-07-18 at 2.29.06 PM.png

I've been using Views for years and on this most recent project, it started automatically encoding certain characters such as:

<a class="btn btn-md btn-maroon resource-link-button" href="[types field='link-url' output='raw'][/types]" target="blank" rel="noopener"> 

See attached screenshot for another example in case the text example above isn't showing the issue.

This seems to be happening only to single quotes and it just started recently. Changing the encoding to the actual ' character makes no difference, they just re-encode as & #039; The code still runs, but is very cluttery.

Disabling all plugins and switching to the default Twenty Twentytwo theme makes no difference.

Please advise. Thank you.

#2420431

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

To troubleshoot this, I'll need to see exactly how and where this code is being used in the back end.

Can you please share temporary admin login details, along with the link to an example page?

Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.

regards,
Waqar

#2421551

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for sharing the admin access.

I checked a number of different views and even saved some temporary changes, but couldn't reproduce the encoding issue.

The views that I checked were:

- Article Cards View
- Collection Cards Loop View
- Collection Cards View
- Homepage Articles View
- Additional Link Buttons Loop View

Screenshot from the view "Additional Link Buttons Loop View", that you mentioned:
hidden link

Can you please check again and see if the issue persists? If it does, please share the exact steps to see it.

#2421747

I am at a loss here. This makes absolutely no sense.
To reproduce the issue, I just log in, go to the view (any view) and the problem is there.

The problem does not seem to be happening in content templates, just views. Example content template: hidden link

I've tried 4 different browsers and on my desktop and laptop and get the exact same issue with all of them. What could possibly be causing this to happen? Even if we don't know the exact cause, why would this happen at all?

#2422385

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

That is very strange.

To be clear, you're only experiencing this on the view's editor screen in the admin area, and the output on the front end is not affected, correct?

I've also requested another colleague of mine to test it on a different computer and browser, but he is not seeing the encoded characters either.

It would be interesting to test the website's clone on a different server for example localhost and then check the views in the same browsers as before.

You can also share a quick video/screencast of how the view shows when you load the view's editor screen.

#2422613

To be clear, you're only experiencing this on the view's editor screen in the admin area, and the output on the front end is not affected, correct?

Correct.

Below is a link to a video of me logging in to the site on my localhost (192.168.1.99), showing the issue, copying the code to a code editor, changing all the encoded characters back to single quotes, showing that it works fine on the front end and also showing that the problem does not happen in content templates.

hidden link

#2423091

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for sharing this video.

I suspect it is most likely caused by one of the browser extensions/add-ons active in the main browser that you use for accessing the admin area.

I know you've already tested this on a couple of different devices and browsers, but it could be that the actual conversion is only taking place in one of them and when you tested the others, it showed the already saved and converted content.

#2425885

Two of my browsers have no extensions or add-ons (Firefox and Safari). I'm confident it has nothing to do with extensions or add-ons. Thank you for your help, but I'm getting the feeling that there's no solution so we can probably close this ticket.

#2426145

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for sharing this and we've recently received another report from a different user, about a similar conversion.

Interestingly, unlike your website, I could see the converted characters in the view's editor screen (but not in the content template editor), on that user's website.

I'm still gathering information to narrow down a pattern and if you allow, I can download a clone/snapshot of your website too, to test it on a different server, for this investigation.

#2426663

You have my permission to take a clone of the site. I'm very curious to find out what more you learn about this issue. Thank you for your help, Waqar!

#2427073

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the permission and I've created the website's clone at:
hidden link

Can you please log in with the same access details that you shared with me and see if you're able to reproduce the issue here?
( I still can't and please test using your own user and the one that you share with me )

#2427419

I just logged in with 3 browsers and saw the same issue. As before, I changed all the

'

to

'

, saved and closed the view and when I opened it again, they changed back to

'

.

In case I didn't mention this before:
M1 iMac
MacOS 12.2.1

I don't have access to a Windows computer to test with.

#2427657

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thanks for writing back.

During further troubleshooting, I noticed that I could only see the issue when logged in as the administrator user "Daniel Brasic". For the other two administrator users, the view's editor showed the content correctly.

It turns out that for this specific user, the option "Disable the visual editor when writing" was checked on the user profile page.
( WP Admin -> Users -> Profile )

Please log in as that user and disable this option and you won't see the encoded characters on the view editor screen.

#2427895

That's it! That fixed the issue! Seems like it shouldn't work that way, but nonetheless, that fixed the problem! Thank you for sticking with it to the end Waqar! Thank you!!!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.