Skip Navigation

[Resolved] Views showing shortcodes if too many image fields are present

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

Problem: If too many image fields are present in the content, Views stops rendering shortcodes and prints them out on the page.

Solution: There is currently a known issue with some newer versions of PHP that have the PCRE regex parser. Some of our shortcode regex algorithms are failing, resulting in shortcodes being printed on to the screen instead of being parsed. We are working on improvements that will prevent this failure. In the meantime, the most practical solution is to disable the PCRE.jit parser by adding this line to your wp-config.php file:

ini_set('pcre.jit', false);
This support ticket is created 6 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.

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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 4 replies, has 2 voices.

Last updated by thomasS-11 6 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#648637

I have a post type showing "products" - it has WP-types custom field type Image.
Works perfect in every page, except from 1 page, where it shows shortcodes instead of rendering them.

I went crazy trying to debug this issue, and found out by coincidense (after trying to recreate that post) that the error happens because the post has too many WP-types images.

As i was creating the new post, i frequently saved and checked the new post, and it worked, untill i was finished uploading all the pictures, then the error happened again - which is why i found out what the issue was.

If i delete some of the pictures (randomly) the images starts to work again.

I can clone the site to a development enviroment where you can test this yourself.

This is the affected post: hidden link

#649275

Hi, as a quick test, could you please remove all the wpv-conditional statements from this template, then refresh the page? If the shortcodes are rendered correctly, then it's most likely related to a known issue with complex regex parsing and pcre.jit. Add this line to your wp-config.php file just before it says "That's all, stop editing" and test again with the conditionals in place:

ini_set('pcre.jit', false);

If the problem is not resolved, let me know and I can create a clone of your site to do some additional tests.

#652220

So i can't add many images if i use conditional fields?
This really looks like an issue to me.
In many cases you would need both many images + conditional fields, and i dont think the right thing to do every time is to edit wp-config on each site.

#652802

I agree it is a significant issue and we are working to resolve that by improving our regex algorithms, however it may or may not be the issue here. Can you please test it out so we can confirm or exclude this as the source of the problem? If you find that it does not resolve the problem, then we may be able to resolve this another way. If it does resolve the problem, then disabling pcre.jit is probably the most practical option right now. If you do not want to add this line to a wp-config.php file, add it on the server in a php.ini file or ask your host(s) to disable it globally for any sites running PHP >= 7.0 and Toolset. Another option is to rewrite your Content Templates and conditionals so they are less complex and less lengthy, but this usually isn't practical and often isn't possible.

#657343

Alright, im glad that you are aware about this and agree with me that it is an issue, and that you are working on it.

adding "ini_set('pcre.jit', false);" resolved the problem. But im looking forward to being able to not modify either php.ini or the wp-config.php file to make Views/Types work properly.

And i agree, it isnt practical and in this case it isnt possible either to rewrite the template structure.