Opened 7 years ago
Last modified 6 years ago
#43804 new defect (bug)
Undefined offset: 0 in ../wp-includes/taxonomy.php on line 1903
Reported by: | vasyltech | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Taxonomy | Keywords: | has-patch reporter-feedback |
Focuses: | Cc: |
Description
The issue is pretty trivial. When there are no terms assigned to a post, the condition on 1894 will return false and this immediately will cause PHP error because $taxonomies array does not have any records inside.
To reproduce the issue, simply call wp_get_object_terms function with post, page or custom post type that does not have a single hierarchical term assigned to.
Attachments (2)
Change History (4)
#1
@
7 years ago
- Component changed from General to Taxonomy
- Keywords reporter-feedback added
Welcome to WordPress Trac @vasyltech
Thanks for the report.
But I'm unable to reproduce this.
I've attached my test in 43804.diff
Can you elaborate further how we can reproduce the bug?
Thanks.
Note: See
TracTickets for help on using
tickets.
Straight forward fix for the "PHP Notice: Undefined offset: 0 in ../wp-includes/taxonomy.php on line 1903" error