Subcategory names unique rules?

AI-generated summary

Subcategory names unique rules?

The discussion revolves around whether subcategory titles and slugs should be unique across the entire platform or only within their parent category. rogerco raises concerns about the current system, which allows subcategories in different categories to have the same slug and title. This can cause issues in certain components, such as the Category Icons Component, where the slug is assumed to be a unique key.

Remah shares that they have multiple forums with the same subcategories, which will be affected by this issue when using the Category Icon theme component. However, they note that the duplicated subcategories will likely have the same icon and settings, minimizing the impact.

rogerco counters Remah’s point, suggesting that there may be cases where different icons are desired for subcategories with the same slug, such as a “help” subcategory under different parent categories.

It seems that subcategory titles and slugs only have to be unique within their parent category.

It is possible for subcategories in different categories to have the same slug (and title)

Is this a good idea? Is there a separate categoryID that we don’t see anywhere that is used as a key field?

I can understand that it is useful to have the same title for a subcategory in different places (for example many categories might have a “Help” category, but shouldn’t the slug at least be unique (perhaps simply by automatically adding a numeric suffix if the slug derived from the name turns out not to be unique)

It causes a problem in the Category Icons Component where the slug is assumed to be available as a unique key to the category.

It has previously caused a problem in this bug

Is this actually a bug? Or are there good reasons to allow subcategories to have the same slugs?

I’m interested in this because I have forums where each category is used by a different group. In the main, categories will have the same sub-categories so this issue will arise when I use the Category Icon theme component. But it seems likely that all the duplicated subcategories will have the same icon and other settings so I probably won’t notice the underlying problem you describe.

I don’t like the theme component assuming unique slugs when they are not. But I can’t think why I would have different icon requirements for subcategories with matching slugs.

You might want the help subcategory under the finance category to have a different icon to the help subcategory under technical. Perhaps you might like all subcategories to use the same or similar icons to their parent category.