After a recent upgrade to PHP 7.1.18, WP v4.9.6 and running Toolset Views 2.6. We are not seeing excerpts.
After looking at debug, it looks query results returns the excerpts but wp-post-excerpt is returning null.
We are seeing nothing in php logs.
Tried passing id directly in loop editor with no success. Also disabled all plugins and switched to default theme with same isssues
Here is an example:
hidden link
query
post_excerpt] => With the debut of the College of Arts and Sciences’ new website, we also debut our new tag line: Synergy Unleashed. At Carolina, teaching, learning and research are transformative processes by which we invent a better future. There is synergy in pairing diverse and sometimes unexpected disciplines.
shortcode
Attributes: {"item":null,"id":null,"post_id":null,"length":"20","count":"word","more":null,"format":"autop","output":"formatted"}
Info: Data received from cache
Thank you!
Excerpt ShortCodes work fine on my local install with those same configurations.
This may be due to some hidden PHP error, can you enable WP Debug and let me know the exact error if there is any?
https://codex.wordpress.org/WP_DEBUG
If the issue persists on your install after using only Toolset and a native WordPress theme, and you inserted the Toolset ShortCode with the GUI (is not malformatted), then we will probably need to take a look at the site locally.
Can you add a copy of the site, in case you cannot see any PHP error on above steps?
https://toolset.com/faq/provide-supporters-copy-site/
Thanks!
I found the issue. In your docs you have this as an usage example for wpv-post-excerpt, but that will return Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead. Should be updated for PHP 7
//Remove any {{caption}} shortcode that the excerpt might include, mainly if it is being taken from the post content:
add_filter('wpv_filter_post_excerpt', 'prefix_strip_captions');
function prefix_strip_captions($excerpt) {
$excerpt = preg_replace('#([[]caption)(.*)([[]/caption[]])#e', '', $excerpt);
return $excerpt;
}
Thanks for this hint. I replicated this issue and can confirm that on PHP 7+ that error will happen.
You will need to call preg_replace_callback () and create a custom call back that returns the replacement string.
We will update that DOC and eventually include a better, PHP 7 compatible example.
This is however not a BUG in Toolset, as the Filter still works.
The filter just allow you to hook your custom code (as example, a preg_replace_callback) to the right moment of the View's "life".
We however need to ensure that the examples provided are working in all cases.