Ticket #6211 (new defect)

Opened 8 months ago

Last modified 5 months ago

allow identical taxonomy slugs in different taxonomies

Reported by: nerrad Assigned to: anonymous
Priority: high Milestone: 2.9
Component: Administration Version: 2.5
Severity: blocker Keywords: has-patch needs-testing
Cc:

Description

Expected usage: I create a category named "Planning for WordPress Upgrades" with the slug "planning" and save. With permalinks on the url would be something like, "http://www.mydomain.com/%categorytoken%/planning.

I create a tag named "planning" and save. With permalinks on the url would be something like "http://www.mydomain.com/%tagtoken%/planning".

However: When saving the tag it will inherit the title of the preexisting category instead of saving as the tag I created. There should be no inheritance between taxonomy's.

Also, when editing the name in either the category or the tags the name will be changed in both the tag taxonomy and the category taxonomy. It is not possible to have different names for different taxonomies with the same slug.

Attachments

same-slug-diff-taxonomy.patch (0.8 kB) - added by nerrad on 03/14/08 04:36:37.
patch to be applied after removing unique index key for the slugs field in the _terms table
same-slug-diff-taxonomy-2.patch (1.7 kB) - added by nerrad on 03/15/08 22:02:20.
adds BOOL canonical param to $args for wp_insert_term

Change History

03/14/08 01:52:39 changed by nerrad

  • keywords set to needs-patch.

03/14/08 04:26:30 changed by nerrad

Looks like this can't be fixed because the current db schema slugs have a UNIQUE key in the _terms table. I can understand wanting to make sure that there are unique slugs per taxonomy but isn't it overkill to have unique slugs across all taxonomies?

I understand the necessity for unique slugs with posts but the current default permalink structure would allow for like slugs in different taxonomies.

I propose that the SLUG field in the _terms table not be UNIQUE and the suggested attached patch be applied to allow identical slugs in different taxonomies

03/14/08 04:36:37 changed by nerrad

  • attachment same-slug-diff-taxonomy.patch added.

patch to be applied after removing unique index key for the slugs field in the _terms table

03/14/08 04:37:25 changed by nerrad

  • keywords changed from needs-patch to has-patch needs-testing.

03/14/08 04:44:41 changed by nerrad

  • summary changed from new terms created with a slug already in db will inherit title of existing term in db even if is different taxomony. to allow identical taxonomy slugs in different taxonomies.

(follow-up: ↓ 7 ) 03/14/08 06:29:02 changed by ryan

  • milestone changed from 2.5 to 2.6.

Taxonomy was designed to keep terms canonical between categories. We can revisit that decision, but not for 2.5.

03/14/08 06:29:23 changed by ryan

Between taxonomies, I should say.

(in reply to: ↑ 5 ) 03/14/08 12:48:56 changed by nerrad

Replying to ryan:

Taxonomy was designed to keep terms canonical between categories taxonomies. We can revisit that decision, but not for 2.5.

Understood - hope it gets revisited :)

03/15/08 16:34:16 changed by nerrad

Keep in mind when revisiting. This decision regarding taxonomies affects not only category and tag intersections but also any future taxonomies plugin authors create. To keep terms canonical between category and tags is one thing but to force that on all future taxonomies might not be the best route to take.

I suggest adding a new 'canonical' paramater to the $args variable that defaults to true and running the current code. Plugin authors can set it to "false" (when calling wp_insert_term to allow inserting a slug with the same name as another taxomony for their taxonomy.

Of course this still requires dropping the index for slugs in the wp_terms table.

03/15/08 22:02:20 changed by nerrad

  • attachment same-slug-diff-taxonomy-2.patch added.

adds BOOL canonical param to $args for wp_insert_term

06/13/08 05:55:04 changed by hakre

Please keep it unique until there is a full featured object modell for anything taxonomic. This here and there hushing leads to nothing but even more chaos. The way it is done now is not that nice but the most failsafe for the time being.

nerrad, even your patches do not fully reflect multiple taxonomies. you just passed it as useless parameter that's all. those different taxonomies have to be reflected in the datastructure as well.