Skip Navigation

[Closed] Escaping of Quotes in View

This support ticket is created 2 years, 8 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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/Hong_Kong (GMT+08:00)

This topic contains 5 replies, has 2 voices.

Last updated by Luo Yang 2 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#2131803

I have a view that tries to display a custom field within one of my posts. Here is the code I use in the "Loop items in" section of the view editor:

<div class="tsv-loop-item">
<div class="tsv-featured"><a href="[wpv-post-url]">[wpv-post-featured-image]</a></div>
<div>
<h2 style="margin-bottom:0;padding-bottom:0;"><span class="tsv-title"><a href="[wpv-post-url]">[Ep [types field="ep"][/types]] [wpv-post-title]</a></span></h2>
<p class="tsv-author">[wpv-post-date format="M j, Y"] | [wpv-post-taxonomy type="guest" format="link"]</p>
<p class="tsv-excerpt">[wpv-post-excerpt length="20" count="word" format="noautop"]</p>
</div>
</div>

Everything is fine when I save the code, and the view works correctly. However, if I go back to the view later to make other edits, the moment I load the view, the code above is changed. The section that says
[Ep [types field="ep"][/types]
is changed as follows:
[Ep [types field='ep'][/types]

Obviously, for whatever reason, your code is escaping my quotes and replacing them with the ''' code.

The problem is, when I save the view back with this text, the display on the front end is all wrong--the content of the "ep" field is left blank. I can work around the problem by reloading the view, changing the ''' entries back to double quotes, and saving the result. But if I subsequently reload the view, the conversion is made again.

This is a bug, and it needs to be fixed. Please get this fixed in your next release.

Thank you.

#2131807

LOL, when I tried to explain the problem, the editor on THIS page screwed up my text! Let me try again using your special formatting instructions...

I have a view that tries to display a custom field within one of my posts. Here is the code I use in the "Loop items in" section of the view editor:

<div class="tsv-loop-item">
  <div class="tsv-featured"><a href="[wpv-post-url]">[wpv-post-featured-image]</a></div>
  <div>
    <h2 style="margin-bottom:0;padding-bottom:0;"><span class="tsv-title"><a href="[wpv-post-url]">[Ep [types field="ep"][/types]] [wpv-post-title]</a></span></h2>
    <p class="tsv-author">[wpv-post-date format="M j, Y"] | [wpv-post-taxonomy type="guest" format="link"]</p>
    <p class="tsv-excerpt">[wpv-post-excerpt length="20" count="word" format="noautop"]</p>
  </div>
</div>

Everything is fine when I save the code, and the view works correctly. However, if I go back to the view later to make other edits, the moment I load the view, the code above is changed. The section that says

[Ep [types field="ep"][/types]]

is changed as follows:

[Ep [types field=\'ep\'][/types]]

Obviously, for whatever reason, your code is escaping my quotes and replacing them with the

\'ep\'

code.

The problem is, when I save the view back with this text, the display on the front end is all wrong--the content of the "ep" field is left blank. I can work around the problem by reloading the view, changing the

\'ep\'

entries back to double quotes, and saving the result. But if I subsequently reload the view, the conversion is made again.

This is a bug, and it needs to be fixed. Please get this fixed in your next release.

Thank you.

#2131809

For god's sake, this editor is ridiculous. The Toolset code that loads the view is changing my double quotes to the symbol 'ampersand' 'hasthtag' 039;.

#2132335
escaping.JPG

Hello,

I have tried it in my localhost with a fresh WP installation + the latest version of Toolst plugins, it works fine, see my screenshot: escaping.JPG

So the problem you mentioned above is abnormal, please check these:
1) Make sure you are using the latest version of Toolset plugins, you can download them here:
https://toolset.com/account/downloads/

2) In case it is a compatibility problem, please deactivate all other plugins, and switch to WordPress default theme 2021, deactivate all custom PHP/JS code snippets, and test again

3) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

#2132673

I have the latest toolset on my system. In fact, I have the latest versions of everything, so that is not the problem.

Disabling plugins isn't really an option here, because the same thing is happening on multiple websites which are all configured in a similar manner. I have a set of plugins that are common across all these websites, and a few differences here and there.

The problem occurs intermittently--i.e. it doesn't happen on every attempt to load the view into the editor. Still, it happens often enough that it can become irritating. As I said, if I see the problem then it is easy to fix, but I sometimes get so focused on something else I'm trying to fix that I don't notice it, and I don't make the correction...until later when I happen to notice the error on the front end of the website.

#2133409

It might be a server issue, as I mentioned above, please get the PHP/JS debug logs from your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

The topic ‘[Closed] Escaping of Quotes in View’ is closed to new replies.