-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Post Terms: Fix fatal error when 'get_the_term_list' returns 'WP_Error' #65848
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Thanks for contributing, @up1512001! Can you share a code snippet for The issue mentions filtering the gutenberg/packages/block-library/src/post-terms/index.php Lines 27 to 30 in 20f35dd
cc @david-binda |
@Mamaduka sorry for the confusion on my end. The thing is that the It would be the case when the As I have mentioned in the related issue, checking the return value of the In order to reproduce the issue I've noticed in production logs, we could filter the
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the additional details, @david-binda!
I can confirm that this fixes the bug ✅
…r' (WordPress#65848) Co-authored-by: up1512001 <up1512001@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: david-binda <davidbinda@git.wordpress.org>
What?
update the
core/post-term
render_block_core_post_terms
function to handleWP_Error
and not throw a fatal error.Why?
fixes #65832
How?
get_the_term_list
as a separate variable and check if it'sWP_Error
then simply return false otherwise return actual output.Testing Instructions
Terms List
block to the post.get_the_term_list
to returnWP_Error
.Screenshots or screencast
Screen.Recording.2024-10-03.at.11.42.19.mov