WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 3 months ago

#30379 new defect (bug)

Creating multiple Categories with same name under 1 parent

Reported by: dd32 Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.9
Component: Taxonomy Keywords: needs-patch
Focuses: administration Cc:

Description

At present this structure is allowed:

Parent
 - C (slug: c)
 - C++ (slug: c-parent)

Attempting to add another 'C' category will fail with A term with the name and slug already exists with this parent..

However, you can create this structure:

Parent
 - C (slug: c)
 - C++ (slug: c-parent)
Parent2
 - C (slug: c-parent2)

and then move the term:

Parent
 - C (slug: c)
 - C (slug: c-parent2)
 - C++ (slug: c-parent)
Parent2

without issue.

The question that remains here, is this what is expected?

Change History (3)

#1 @Ipstenu
5 years ago

  • Version changed from trunk to 3.9

Not a new issue (whew). Happens on 3.9 too and probably further.

It's expected behavior, in that it's not possible to make a child cat with the same name. Now I would think it should be possible, since it can just as easily toss the -2 appellation up in there.

Hierarchical, and it matches an existing term, Do not allow same "name" in the same level.

So we did intend to do this. May be worth a revisit.

#2 @boonebgorges
5 years ago

  • Milestone changed from 4.1 to Future Release

It's expected behavior, in that it's not possible to make a child cat with the same name. Now I would think it should be possible, since it can just as easily toss the -2 appellation up in there.

There's no technical reason why we can't allow terms with the same name+parent. But in the interface, it's not ideal: there's no way to tell, given a list of category checkboxes, which "C" is c and which is c-parent2. So my instinct is the opposite of ipstenu's: we should be preventing the term from being moved here.

Since this is not a regression in 4.0, and since fixing it either way will involve a low-level change to wp_insert_term() or wp_update_term() that is likely to have other consequences, I'd like to suggest that we move it out of the 4.1 milestone.

#3 @chriscct7
4 years ago

  • Focuses administration added
  • Keywords needs-patch added
Note: See TracTickets for help on using tickets.