core icon indicating copy to clipboard operation
core copied to clipboard

There aren't API or Viewtool methods to get a category by velocityvarname

Open mabouza opened this issue 13 years ago • 7 comments

We have a unique velocityvarname field on categories, but the API doesn't have a method to get a category by the velocity varname.

We should also have a viewtool method once we have the API method.

mabouza avatar Jan 12 '13 01:01 mabouza

we can add this but I think its a great idea. the intention was for people to use the Key. That will use the cache. We don't want to add too many as we want to keep the cache clean.

jtesser avatar Jan 25 '13 12:01 jtesser

The addition of the velocityvarname field was a mistake imho. Instead of adding it as a field, we should have just extended the idea of the key field. You should use the key field for unique ids and gettings.

On Fri, Jan 11, 2013 at 8:35 PM, Maru Ahues Bouza [email protected]:

We have a unique velocityvarname field on categories, but the API doesn't have a method to get a category by the velocity varname.

We should also have a viewtool method once we have the API method.

— Reply to this email directly or view it on GitHubhttps://github.com/dotCMS/dotCMS/issues/1808.

dotcmsCodeReview avatar Jan 25 '13 13:01 dotcmsCodeReview

NOt really the key is different and NOT required. It could have been combined but they are different. The key is allowed to have characters the variable is not.

jtesser avatar Jan 25 '13 14:01 jtesser

Seems inconsistent to only provide tooling to ONLY pull on a non-required field that anyone who has edit on categories can change and break a category pull.. mess up menus displaying category names... etc. We pull by velocity varname as a norm... which is not changeable once set. This ensures stability of velocity pulls/tools that rely upon those varnames. It is feasable that a standard publisher might need to create/manage categories... thereby making tooling that relies ONLY on a mutable key field that isn't even required... seems non-standard and prone to causing site breaks in velocity pulls based on cat key.

DeanGonzalez avatar Jan 25 '13 15:01 DeanGonzalez

Same as roles :-)

jtesser avatar Jan 25 '13 15:01 jtesser

Valid statement... I was just concerned that more users might be able to edit Cats (and mess up pulls), than users that are allowed to edit roles in the system... just throwing my penny thought out there... you guys know better than I the implications of the change, so I submit to the higher powers... :-)

DeanGonzalez avatar Jan 25 '13 15:01 DeanGonzalez

That's exactly why I don't like using the category key, it can be easily changed and people won't know what they messed up until content stops showing up on the site randomly.

On Fri, Jan 25, 2013 at 7:59 AM, DeanGonzalez [email protected]:

Valid statement... I was just concerned that more users might be able to edit Cats (and mess up pulls), than users that are allowed to edit roles in the system... just throwing my penny thought out there... you guys know better than I the implications of the change, so I submit to the higher powers... :-)

— Reply to this email directly or view it on GitHubhttps://github.com/dotCMS/dotCMS/issues/1808#issuecomment-12706676.

Community Manager

dotCMS Main: 305.900.2001 Fax: 305.397.2579 www.dotcms.com http://www.twitter.com/dotCMS http://www.facebook.com/dotCMS http://www.twitter.com/mabouza

Please consider the planet before printing this email.

mabouza avatar Jan 25 '13 16:01 mabouza