Ticket #1787 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

Subcategories with same name not addressable

Reported by: ringmaster Assigned to: ringmaster
Priority: normal Milestone:
Component: General Version: 1.6
Severity: normal Keywords: category heirarchy bg|patch
Cc:

Description

If you create two categories named "subcategory" under separate primary categories ("one" and "two", for example), such that the categories are accessible via:

/category/one/category AND /category/two/category

WordPress fails to find the second category.

The attached patch attempts to select the category based on the full path of the category, not just the last category name in the heirarchy. Failover is included to use just the last category specified in the heirarchy, similar to the current implementation.

This implementation extends the category cache to include full path information upon cache generation. This info is used to index full category paths to their category IDs.

A similar approach might be used to affect the same problem within the page heirarchy.

Attachments

heir_cats.diff (3.0 kB) - added by ringmaster on 10/24/05 15:55:30.
Patches functions.php and classes.php to find subcategories based on their full path.

Change History

10/24/05 15:55:30 changed by ringmaster

  • attachment heir_cats.diff added.

Patches functions.php and classes.php to find subcategories based on their full path.

10/25/05 22:49:32 changed by ryan

How about storing the full path in category_nicename? This way we wouldn't have to worry about duplicate names in the DB, and we wouldn't have to construct it on the fly when setting up the cache.

We'd need to add some code to the upgrade to put the full path in category_nicename and modify wp_insert_category() so that it inserts the full path.

10/27/05 22:05:02 changed by ryan

Putting the full path in the nicename requires quite a lot of changes, so we'll just go with the original patch.

10/28/05 01:14:58 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [2968]) Use full hierarchy when resolving category URIs. fixes #1787 Props: ringmaster Owen

11/30/06 19:41:47 changed by

  • milestone deleted.

Milestone 2.0 deleted