-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Post Terms: Fix fatal error when 'get_the_term_list' returns 'WP_Error' #65848
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
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 |
Mamaduka
left a comment
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 <[email protected]> Co-authored-by: Mamaduka <[email protected]> Co-authored-by: david-binda <[email protected]>
What?
update the
core/post-termrender_block_core_post_termsfunction to handleWP_Errorand not throw a fatal error.Why?
fixes #65832
How?
get_the_term_listas a separate variable and check if it'sWP_Errorthen simply return false otherwise return actual output.Testing Instructions
Terms Listblock to the post.get_the_term_listto returnWP_Error.Screenshots or screencast
Screen.Recording.2024-10-03.at.11.42.19.mov