Skip Navigation

[Fixed in next Release] Closing shortcode [/wpml-string] exposed on website

This support ticket is created 3 years, 7 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
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: Africa/Casablanca (GMT+01:00)

This topic contains 21 replies, has 2 voices.

Last updated by maximilianD 3 years, 4 months ago.

Assisted by: Jamal.

Author
Posts
#1788721

After updating Toolset to the latest version, the closing tag [/wpml-string] is exposed on my website.
Example: /produkte/dynamische-hoersprechgarnitur-5

#1790613

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello and thank you for contacting the Toolset support.

I logged into your website and checked the issue. Then I created a new content template with the legacy editor and added some shortcodes to it, the issue was not reproduced on it, check its results here hidden link

Then I created another content template and I tried to build it with the WPBakery page builder, but it did not open its GUI. Check this screenshot hidden link

To better analyze this issue, I would like to take a copy of your website and work on it locally, would you agree to let me install the Duplicator plugin and take a copy?

#1799775

Hello Jamal,
I was on holiday last week.
It would be great if you could take a copy to find the problem.

#1800219
2020-10-05.png

I just tested the Wpbakery Editor, and it showed up.

#1801503

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

I built a Duplicator copy but when I download it, the file is only a few KB. Check this screenshot hidden link
Can you please upload the copy to a sharing service such as Dropbox or GDrive, or allow me FTP access to try downloading it. Your next reply will be private to let you share the download link safely.

#1801527
#1801625

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Thank you. I took the Duplicator copy and worked on it locally. I just want to let you know that I am still working on it, I did not find a fix yet, but I'll get back to you as soon as I find something.

#1807949

Hi Jamal,
any update?

#1809987

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello,

Our 2nd Tier has worked on a copy of your website and was not able to fix the issue on the existing content template. So, he started removing parts of it until he found that some conditions are not wrapped inside the parenthesis, especially the conditions that use "OR". For example, this conditions:

{!{wpv-conditional if="( $(wpcf-a-kontakt-auflage) ne '' ) OR     ( $(wpcf-r-kontakt-auflage) ne '' ) OR     ( $(wpcf-u-kontakt-auflage) ne '' ) OR     ( $(wpcf-a-kontakt-handapparat) ne '' ) OR     ( $(wpcf-r-kontakt-handapparat) ne '' ) OR     ( $(wpcf-u-kontakt-handapparat) ne '' ) "}!}

Should be wrapped inside parenthesis:

{!{wpv-conditional if="(
    ( $(wpcf-a-kontakt-auflage) ne '' ) OR 
    ( $(wpcf-r-kontakt-auflage) ne '' ) OR 
    ( $(wpcf-u-kontakt-auflage) ne '' ) OR 
    ( $(wpcf-a-kontakt-handapparat) ne '' ) OR 
    ( $(wpcf-r-kontakt-handapparat) ne '' ) OR 
    ( $(wpcf-u-kontakt-handapparat) ne '' ) 
    )"}!}

I tried to do this on the copy that I have, and I wrapped these conditions inside the parenthesis, but it did not work for me. I suspect that this happens because of this known issue:
https://toolset.com/errata/shortcodes-in-conditionally-displayed-content-may-not-be-executed-on-the-front-end/

So, I'll suggest, that you start working on a new content template, gradually, adding wrapped conditions, until you achieve the design that you desire.
Make sure, that the content between a conditional shortcode is not big enough to break the PHP limit described in the known issue.

Let us know if you still got stuck on something.

#1811939

The problem only occured after the latest update of toolset so I doubt it has anything to do with php limitations especcially since the content of my custom fields is quite small.

Also I can not spot the difference between the first and the second code snippet of your latest post.

Is there any way you can check this again?

#1812111
2020-10-15 11_27_21-WordPress-Archiv bearbeiten ‹ HOLMCO — WordPress.png
2020-10-15 11_30_04-Produkte – HOLMCO.png
2020-10-15 11_30_33-Produkte – HOLMCO.png
2020-10-15 11_30_46-WordPress-Archiv bearbeiten ‹ HOLMCO — WordPress.png

In my product archive /wp-admin/admin.php?page=view-archives-editor&view_id=1187
I have the following code:

	[wpv-filter-search-box placeholder="[wpml-string context="wpv-views"]Produktsuche[/wpml-string]" output="bootstrap" class="suche"]

It is already marked red in the backend (see screenshot) and causes problems in the frontend ([/wpml-string] exposed in the sidebar)
When I remove the above code or even just the [wpml-string] part, the problem is resolved in the sidebar. ([/wpml-string] not exposed anymore)

There must have been a change in the last update that is causing this behaviour, as I have not changed any of the code.

New threads created by Jamal and linked to this one are listed below:

https://toolset.com/forums/topic/searchbox-filter-placeholder-issue/

#1812279

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Thank you for your feedback and for talking about this archive template too.

Please notice that the condition that I shared is wrapped inside of ():

( (condition1) OR (condition2) )

Instead of:

(condition1) OR (condition2)

I worked again on the Products content template in my local copy. And I fixed some separator=', ' tags that were having a
tag inside:

<br class="" />

Check this screenshot for example: hidden link

But the real issue turns to be wrapping the "wpml-string" domain in single quotes(wpv-views):

[wpml-string context='wpv-views']Besprechnungsabstand[/wpml-string]

Wrapping it on double quotes fixed it:

[wpml-string context="wpv-views"]Besprechnungsabstand[/wpml-string]

Regarding the archive template placeholder, I believe that it might be another issue, related to the search box shortcode rather than an issue with the "wpml-string" shortcode. I have created a separate ticket to work on it.

I updated the double quotes on some shortcodes on your website and it is working now. Check this screenshot hidden link

#1815933

Hello Jamal,

I found the real problem.
After I remove the following part from the template, the problem is gone

format='FIELD_VALUE-[wpml-string context="wpv-views"]A[/wpml-string] '

It seems like, that in the latest update (3.4) changes were made to the format attribute. The problem occurs when another shortcode is inside the format attributes as shown above. This needs to be fixed.

Please test it yourself and add this problem to the errata page so that I can track the progress and update as soon as this is fixed.

#1816187

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Thank you for your feedback.

I looked into our shortcodes documentation and I could not find a shortcode that could accept "FIELD_VALUE-A" for the "format" argument.
When displaying a number with the Types shortcode, you can pass "FIELD_NAME" or "FIELD_VALUE", but you can't pass something as "FIELD_VALUE-A"
So, I would say, that it is expected to not allow wpml-string shortcode inside of it, even if this was working on previous versions.

If, on the other hand, you are using a different custom field type, please explain, why would you use wpml-string shortcode in its format attribute.

I have also created a clean install if you want to reproduce the issue on it hidden link

#1816209

There are anumber of cases where you need to show a unit that is different from the field name.
In my case I need to show the kind of electrical contacts A, U, R- Contacts
It needs to be possible to add any suffix or prefix to the format just like it was possible a couple of weeks ago.

Also: It currently is possible to add any prefix or suffix to the format: "FIELD_VALUE-A", "FIELD_VALUE-ANY SUFFIX"
The only problem is, that it's not possible to translate it