modxcms / revolution

MODX Revolution - Content Management Framework
https://modx.com/
GNU General Public License v2.0
1.36k stars 528 forks source link

Allow duplicated category names in other levels #9052

Closed bertoost closed 10 years ago

bertoost commented 11 years ago

bertoost created Redmine issue ID 9052

For my project I need a lot of custom components. For all this components I do have snippets for listings, detail pages etc. etc. but also the most components do get hooks (for FormIt) to process data submitted by registerforms, editforms etc.

My category structure for this is

Now because there will be several snipptets, I thought to create a sub category for each component category called "Hooks" to store the hook snippets in. This isn't possible because there's a check on the category name. This one should be possible on another level. So the combination of "parent" and the "name" should be unique I think.

Besides that; "creative freedom" .... I should be able to mess this up as I want, right? ;-)

ReSpawN commented 11 years ago

ReSpawN submitted:

Agreed Bert, we also desperately need this one! We've got about 40 categories as is in a root level, not to mention the sub levels...

BIG feature request!

dimmy commented 11 years ago

dimmy submitted:

We had the same problem with visioncart thats why we prefixed all menuitems with storename, the strange thing is that normaly they use id's for all things in modx like chunks snippets tv etc, but not for the menu... they use the name that has to be unique. WHY??? just use an unique ID for each menu item, Problem solved...

mindeffects commented 11 years ago

mindeffects submitted:

My off-topic 2 cents: CONTEXTs are also not organized by IDs but by their name, so its key=value. Would love to see that changed thus making a "rename context" possible.

bertoost commented 11 years ago

bertoost submitted:

Context sort can be changed in the system settings! On topic...

Found there is an "unique" index on the database level only on the "category" field (the name). This should be changed to a combination of "category" and "parent" field. Then the create processor etc. should check "alreadyExists" together with the parent, which is given by the "create category" window.

Really want to have this!!

+1 it if you like! ;-)

bertoost commented 11 years ago

bertoost submitted:

My test works.. http://i.oostdesign.nl/s/modx-category-duplicated-names.png (green and last line) Changed the unique index to a combi of both fields and changed the create processor

The update processor doesn't check parent either!! Moving same-named category to the same parent looks like it works, but after F5, it's back at it's old parent again ;-)

bertoost commented 11 years ago

bertoost submitted:

I have made my tests compatible and did a pull request.. https://github.com/modxcms/revolution/pull/432

rtripault commented 10 years ago

This should be fixed, so closing