WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 4 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)

comment:1 janeforshort5 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.

comment:2 Denis-de-Bernardy5 years ago

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

comment:4 dd324 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/

comment:5 dd324 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

comment:6 dd324 years ago

Is anyone aware of anything that this will break?

comment:7 nacin4 years ago

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

comment:8 prettyboymp4 years ago

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

comment:9 prettyboymp4 years ago

  • Keywords close added

comment:10 dd324 years ago

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