#7701 closed defect (bug) (duplicate)
Don't include current category or childeren in "Category Parent" dropdown
| Reported by: | mtekk | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Administration | Version: | 2.6.1 |
| Severity: | minor | Keywords: | needs-patch |
| Cc: | Focuses: |
Description
In #3278 it was reported that categories should not be allowed to be their own parent. Even though this was fixed in [4490], in 2.6.1 the current category and its children still appear in the "Category Parent" dropdown list. They probably should be removed as they are not valid options (they end up being ignored if selected). I also tested this in [8841] and it still has this problem.
Attachments (1)
Change History (9)
#2
@
17 years ago
- Keywords needs-patch added; category parent removed
- Milestone 2.7 → 2.8
- Resolution fixed
- Status closed → reopened
It's not fixed in r11063, the dropdown still includes child categories of a parent (along with itself). It can't actually set to those invalid values, but it should be removed from the dropdown. I'll look into a solution.
#3
follow-up:
↓ 4
@
17 years ago
Ok, we're using wp_dropdown_categories for the dropdown, but there is no exclude being used at the moment to exclude the current category. That's the first problem, and it's easily fixable, see my patch 7701-edit-category-form.php.diff. The second part is we probably should have wp_dropdown_categories exclude the children of categories that have been excluded.
#4
in reply to: ↑ 3
@
17 years ago
Disregard my last comment, I found the newish exclude_tree option (codex does not have it documented yet). The other thing is, if hierarchical is set to true, exclude should work the same as exclude_tree, however the code seems to not work (this is in the function wp_list_categories). Now, the only bug in my updated patch is that the hide_empty setting is over riding the exclude_tree option (the empty children of an excluded category still end up in the list, a problem is in get_terms I believe).
#5
@
17 years ago
- Milestone 2.8 → Future Release
Punting due to feature freeze. Reconsider with next release.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Fixed in 2.7, I believe.