WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 2 years ago

#15741 new defect (bug)

Taxonomy: Duplicate term slug error message refers to the name

Reported by: Nao Owned by:
Priority: normal Milestone: Awaiting Review
Component: Taxonomy Version: 3.0.2
Severity: normal Keywords: dev-feedback
Cc: kapeel.sable@…, sheri@…, dimadin

Description

You can't create a term if there is another existing term with the same slug. The error message indicates this warning incorrectly, referring to the term "name" instead of "slug":

A term with the name provided already exists with this parent.

Problem in action:

  1. Create a category name "Example" with slug "example" without any parent category.
  2. Once that is saved, try creating the exact same category again.
  3. "A term with the name provided already exists with this parent." error shows up.
  4. Create a category name "Example" with slug "example-2".
  5. No error. Category with the same name can be created, contrary to the error message in step 3.

The error message should refer to the slug not name if this is an intended behavior. If the same term name should not exist under one level, step 4 should not be allowed either (especially with Tags).

Attachments (2)

15741.diff (884 bytes) - added by kapeels 3 years ago.
15741.2.diff (658 bytes) - added by designsimply 2 years ago.

Download all attachments as: .zip

Change History (8)

kapeels3 years ago

comment:1 kapeels3 years ago

  • Cc kapeel.sable@… added
  • Keywords has-patch added

comment:2 nacin3 years ago

  • Milestone changed from Awaiting Review to 3.1

comment:3 nacin3 years ago

  • Keywords reporter-feedback added
  • Milestone changed from 3.1 to Awaiting Review

Based on the code around the diff, this looks inaccurate. Note fields => names, and the PHP comment.

comment:4 ocean902 years ago

  • Keywords dev-feedback added; has-patch reporter-feedback removed

See also Line 1651 | Line 1972 (trunk). Seems like expected behaviour.

Wontfix?

comment:5 designsimply2 years ago

  • Cc sheri@… added

I think the ticket intention is to change 'name' to 'slug' in the line below the comment that says "Same name, same slug."

designsimply2 years ago

comment:6 dimadin2 years ago

  • Cc dimadin added

I was thinking should I open a new ticket for this, but lets stay here for now.

If you go to edit screen of existing term and try to edit slug (by changing it to one that is used by other term), you only get error "Item not updated" but you don't get reason why it wasn't updated.

There should be explanation as there is one when you use Quick Edit.

Note: See TracTickets for help on using tickets.