Make WordPress Core

Opened 5 years ago

Closed 21 months ago

#16475 closed defect (bug) (duplicate)

Displaying submenus in custom taxonomy of active parent

Reported by: nick4fake Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1
Component: Administration Keywords: has-patch
Focuses: Cc:

Description (last modified by markjaquith)

In a hierarchical taxonomy, if a top level item in the hierarchy is selected when editing a post, after save that item's orphaned children and grandchildren will also show as top level items. It flattens the hierarchy.

Attachments (2)

16475.patch (3.0 KB) - added by tamme 5 years ago.
16475_2.patch (3.3 KB) - added by tamme 5 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 @markjaquith5 years ago

  • Keywords taxonomy menus removed
  • Milestone changed from Awaiting Review to Future Release

Here is my hierarchy:


After Selecting "Top Level 2" and saving:


Reproduced in 3.0, so not a new bug. How hierarchical taxonomies are displayed might need a rethink.

comment:2 @markjaquith5 years ago

  • Description modified (diff)

comment:3 @tamme5 years ago

I have added and attachment (16475.patch) that changes the way the categories are displayed. Its a proposed solution for the problem. The hierarchy will remain intact after a save, and it will sort the categories putting the checked ones at the top. When sorting, higher levels have priority over lower levels.

For instance in the above example if you would check 'Top Level 2' and 'Foo Child2' and 'foo grandchild', you would get the following hierarchy after saving.

[x]Top Level 2

[x]Foo Child2

[ ]Foo Child

[x]foo grandchild

[ ]Top Level 2

The downside to this way of displaying the categories is that there is a bigger chance that they are not all shown after loading the page. The user might have to scroll.

Last edited 5 years ago by tamme (previous) (diff)

@tamme5 years ago

comment:4 @tamme5 years ago

  • Keywords ui-feedback ux-feedback added

comment:5 @tamme5 years ago

The code above isn't 100% correct. I will fix the mistake and put the new version here later.

@tamme5 years ago

comment:6 @tamme5 years ago

The second patch does not contain any problems anymore.

comment:7 @SergeyBiryukov4 years ago

  • Keywords has-patch added

comment:8 @helen21 months ago

  • Keywords ui-feedback ux-feedback removed
  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #10982; a filter was introduced in #20054 to change the behavior as desired.

Note: See TracTickets for help on using tickets.