[opencms-dev] OpenCms9: Categories and Detail-Names get mixed up

Christoph Fröhlich cfauto at folge2.de
Wed Jul 2 17:30:41 CEST 2014


Dear all,

after migrating a major installation from OpenCms 8 to 9 there are some categories that can not be saved in a content type anymore.

The underlying problem is that OpenCms9 takes a category with the name
	"/_categories/Fach-Kategorien/Interkulturelle-Arbeit/"

erroneously  for an article with a similar name
	"/sites/default/.content/articleprof/migration-interkulturelle-arbeit.html"


The problematic code is on line 295 of
---------------------------------------------------
org.opencms.xml.types.CmsXmlCategoryValue.setStringValue(CmsObject, String) 
---------------------------------------------------


It reads: 
---------------------------------------------------
path = OpenCms.getLinkManager().getRootPath(cms, path);
---------------------------------------------------

It translates "path" from
  "/_categories/Fach-Kategorien/Interkulturelle-Arbeit/"
to	
  "/sites/default/.content/articleprof/migration-interkulturelle-arbeit.html"


The translation seems to be a new "feature" of LinkManager, who tries too avidly finding a detail url where none is desired.

This seems to be a major problem to us, since we use categories heavily in this installation.

Furthermore I'm a bit scared about this bug. LinkManager.getRootPath() seems to be a widely used  method and this behavior is rather unpredictable. 
I could replace LinkManager with a custom implementation but I do not overview in which situation the current behavior may make sense.

Did others encounter this bug as well? Did you manage to workaround it?


Thanks and regards

Christoph



PS
The bug happens in the old StandardEditor as well as in the new Acacia-Editor. 
And it is totally agnostic to whether we configure the field as "OpenCmsCategory" or as "OpenCmsVfsFile" (CmsXmlVfsFileValue uses the same call to LinkManager)





More information about the opencms-dev mailing list