Skip to content
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

SIT-2935: get_the_terms() can return an array, false or WP_Error #190

Closed
barryceelen opened this issue Feb 15, 2022 · 4 comments · Fixed by #215
Closed

SIT-2935: get_the_terms() can return an array, false or WP_Error #190

barryceelen opened this issue Feb 15, 2022 · 4 comments · Fixed by #215
Assignees
Labels
bug Something isn't working
Milestone

Comments

@barryceelen
Copy link
Contributor

get_post_breadcrumb() uses count() on the result of get_the_terms() but does not check if it is a list of terms first.

@barryceelen barryceelen added the bug Something isn't working label Feb 15, 2022
@jeffpaul jeffpaul added this to the 1.0.9 milestone Feb 15, 2022
@jeffpaul
Copy link
Contributor

Since this has not been prioritized by the Sophi team, I'm moving this out to the 1.1.0 milestone.

@jeffpaul jeffpaul modified the milestones: 1.0.9, 1.1.0 Feb 16, 2022
@jeffpaul
Copy link
Contributor

@barryceelen noting that this was for a post type that does not have a taxonomy associated with it, is that a current impact for posts/pages on your client site or just a note from testing a random CPT?

@jeffpaul jeffpaul modified the milestones: 1.0.10, 1.1.0 Feb 28, 2022
@barryceelen
Copy link
Contributor Author

@jeffpaul our site uses a post type without a taxonomy, which is indexed by sophi. As a result, the error logs keep filling up with this error. The fix would be to scan the plugin looking at where it wants to use get_the_terms() and do the due diligence of checking its return value before using it.

@jeffpaul jeffpaul changed the title get_the_terms() can return an array, false or WP_Error SIT-2935: get_the_terms() can return an array, false or WP_Error Mar 11, 2022
@jeffpaul
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants