Opened 8 years ago
Closed 5 months ago
#43804 closed defect (bug) (invalid)
Undefined offset: 0 in ../wp-includes/taxonomy.php on line 1903
| Reported by: | vasyltech | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Taxonomy | Version: | |
| Severity: | normal | Keywords: | has-patch reporter-feedback |
| Cc: | Focuses: |
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 (5)
#1
@
8 years ago
- Component General → 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Straight forward fix for the "PHP Notice: Undefined offset: 0 in ../wp-includes/taxonomy.php on line 1903" error