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
note that while this does improve things, I'm not 100% sure it solves the problem. My initial attempt also involved trying to set the current post the same way the_post does which did nothing
tomjn
added a commit
to tomjn/ElasticPress
that referenced
this issue
Feb 21, 2023
When indexing a post, the content gets rendered, and shortcodes/blocks/etc may rely on the global `$post` variable to provide context that will be missing when performing an ES index.
In my case it was a block which did not handle the value being missing, but context dependent content would generate PHP warnings/errors or incorrect data
Describe the bug
postId
context to render post specific content.$post
object is set. This is fine because my block is only available in posts, and is inside a post.$post
is undefinedthe_content
filter to retrieve my posts contentpostId
expecting an integernull
and the application crashesSteps to Reproduce
Attempt to index a site that uses the
postId
in a block rendererScreenshots, 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: