WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 8 years ago

#8167 closed enhancement (duplicate)

Unable to create 2 categories with the same title under different parents

Reported by: DD32 Owned by: dd32
Milestone: Priority: normal
Severity: normal Version: 2.7
Component: Taxonomy Keywords: close
Focuses: Cc:

Description

If you attempt to create 2 categories: \Category1\TestCategory and \Category2\TestCategory, TestCategory will fail to be created under the 2nd category, failing on "The category you are trying to create already exists."

It appears that category_exists() which in turn calls is_term() doesnt support hierarchies, Instead mearly checking to see if a Term with that Name exists within the taxonomy.

Partially related to: #5034

Change History (10)

#1 @janeforshort
9 years ago

  • Milestone changed from 2.8 to 2.9
  • Type changed from defect to enhancement

The requirement for a unique name for categories regardless of hierarchy is documented in the codex, so this should be categorized (heh) as a feature request/enhancement rather than a defect.

#2 @Denis-de-Bernardy
8 years ago

  • Keywords needs-patch added
  • Milestone changed from 2.9 to Future Release

#4 @dd32
8 years ago

This has been "fixed" during #11838 (I assume)

The slugs created seem a bit strange however.. but the Names work.

Eg:

Category: Test
Parent: None
slug: test
URL: /category/test/

Category: Test
Parent: Parent Cat
slug: test-parent-cat
URL: /category/parent-cat/test-parent-cat/

#5 @dd32
8 years ago

  • Keywords needs-patch removed
  • Milestone changed from Future Release to 3.0

The slugs created seem a bit strange however..

Thats due to the changes made in: (In [6157]) Term with slug that conflicts with existing term with different parent gets a new term entry with a unique slug. see #5034

#6 @dd32
8 years ago

Is anyone aware of anything that this will break?

#7 @nacin
8 years ago

  • Owner set to dd32
  • Status changed from new to assigned

#8 @prettyboymp
8 years ago

Can't we close this and have any fixes to the slugs (if any) be put under #5034?

#9 @prettyboymp
8 years ago

  • Keywords close added

#10 @dd32
8 years ago

  • Milestone 3.0 deleted
  • Resolution set to duplicate
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.