You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we add highlighting to an excerpt, we do so with the get_the_excerpt filter, and in our callback we get the full post content and apply the the_content filter to it.
The problem is that if the post contains a Query Loop block with a Post Excerpt block, or any other block that uses the_excerpt(), an infinite loop will occur.
As per a comment, our callback "reproduces wp_trim_excerpt filter", but it appears to be out of date. The latest version of wp_trim_excerpt() in core appears to use excerpt_remove_blocks(), which excludes the query loop blocks from the excerpt, which would avoid the issue. We will need to do something similar.
Steps to Reproduce
Enable Excerpt highlighting.
Create a Post with a Query Loop block and a Post Excerpt block inside the Post Template block.
Search for that post. A timeout or memory limit error should occur.
Screenshots, screen recording, code snippet
No response
Environment information
No response
WordPress and ElasticPress information
No response
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Describe the bug
When we add highlighting to an excerpt, we do so with the
get_the_excerpt
filter, and in our callback we get the full post content and apply thethe_content
filter to it.ElasticPress/includes/classes/Feature/Search/Search.php
Lines 291 to 292 in 0217bee
The problem is that if the post contains a Query Loop block with a Post Excerpt block, or any other block that uses
the_excerpt()
, an infinite loop will occur.As per a comment, our callback "reproduces wp_trim_excerpt filter", but it appears to be out of date. The latest version of
wp_trim_excerpt()
in core appears to useexcerpt_remove_blocks()
, which excludes the query loop blocks from the excerpt, which would avoid the issue. We will need to do something similar.Steps to Reproduce
Screenshots, screen recording, code snippet
No response
Environment information
No response
WordPress and ElasticPress information
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: