#12533 closed defect (bug) (fixed)
Parent term count
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | highest omg bbq | Milestone: | 3.0 |
| Component: | Taxonomy | Version: | 3.0 |
| Severity: | blocker | Keywords: | has-patch commit |
| Cc: | jeff@…, steph@… |
Description (last modified by dd32)
Hierarchical term parents (including categories) count stays at 0 when using child terms. This results in a 404 error when trying to pull up the term/category page for a parent term which has children with posts.
When viewing a Parent term of a custom taxonomy, Objects in the children of the term are not shown.
Attachments (4)
Change History (24)
comment:1
jfarthing84 — 3 years ago
comment:2
jfarthing84 — 3 years ago
Upon even further investigation, if you pull up an empty custom taxonomy (hierarchical or not), you get a 404 error rather than the default page displaying "No posts found" which would display if you pulled up an empty category.
- Milestone changed from Unassigned to 3.0
comment:5
jfarthing84 — 3 years ago
Thanks. You will also have to add the 'hide_empty=>false' flag to the is_tax section og WP_Query::get_queried_object().
Also, there still is a problem with custom hierarchical taxonomies.
Thanks. You will also have to add the 'hide_empty=>false' flag to the is_tax section og WP_Query::get_queried_object().
The changeset doesnt show it very well, but thats where it is.
Hierarchical term parents (including categories) count stays at 0 when using child terms.
This depends on if the arg 'pad_counts' is set or not, By default, its not. Where are you seeing it not being reported correctly?
comment:7
jfarthing84 — 3 years ago
Forget the count. I was just saying, it is not taking child terms into account at all.
Look at how categories are handled and then look at how taxonomies are handled. You'll clearly see that the taxonomy handling lacks any support for hierarchical taxonomies.
- Description modified (diff)
- Keywords dev-feedback removed
Look at how categories are handled and then look at how taxonomies are handled. You'll clearly see that the taxonomy handling lacks any support for hierarchical taxonomies.
Are you saying, That visiting /tax/parent/ is not showing posts in /tax/parent/child/ too? - Sorry, I didnt quite understand that in the original ticket description.
Showing the children always confused me, but i can see why it would be required.
comment:9
follow-up:
↓ 10
jfarthing84 — 3 years ago
Yea, exactly.
Say you are using something like this:
United States
- Alabama
- Alaska
- Etc...
In most cases, you will only assign a post to one of the child terms. Then, if you visit the parent term (you wanted to see all pots in the US), you should see ALL child posts.
comment:10
in reply to:
↑ 9
scribu — 3 years ago
- Keywords needs-patch added
Replying to jfarthing84:
Say you are using something like this:
United States
- Alabama
- Alaska
- Etc...
In most cases, you will only assign a post to one of the child terms. Then, if you visit the parent term (you wanted to see all pots in the US), you should see ALL child posts.
Agreed.
comment:11
jfarthing84 — 3 years ago
- Keywords has-patch added; needs-patch removed
comment:12
sillybean — 3 years ago
- Cc steph@… added
comment:13
jfarthing84 — 3 years ago
So, this is ready to go, no?
comment:14
scribu — 3 years ago
- Keywords commit added
12533.2.diff:
- bring in empty terms only for hierarchical taxonomies
- replace a count() check with !empty()
12533.3.diff:
- remove redundant whitespace
comment:15
scribu — 3 years ago
Previous patches did not handle the case where $qtaxonomy? was empty.
This is fixed in 12533.4.diff
comment:16
dd32 — 3 years ago
This is fixed in 12533.4.diff
Patch looks good overall, I'll add it to the testing queue.
comment:17
dd32 — 3 years ago
- Resolution set to fixed
- Status changed from new to closed
comment:18
scribu — 3 years ago
It should have been "Props jfarthing84, scribu", since he submitted the initial patch. Oh well...
comment:19
dd32 — 3 years ago
It should have been "Props jfarthing84, scribu",
My apologies to jfarthing84, I didnt realise he'd submitted the first patch when committing.
comment:20
jfarthing84 — 3 years ago
I was going to say that. But yeah, "Oh well."

It seems this is just affecting hierarchical custom taxonomies (which is still just as important).