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

Patric Dosch patric.dosch at virtual-identity.com
Wed Jul 2 18:18:37 CEST 2014


Hey Christoph,

I cannot quite understand your problem, but I've renamed the folder when updating from 9.0 to 9.1. The new name is ".categories". 
public static final String REPOSITORY_BASE_FOLDER = "/.categories /." in org.opencms.relations.CmsCategoryService

I think this has solved my problems. But it was only a test and not a real project.


Oh maybe here org.opencms.relations.CmsCategoryService.getRepositoryBaseFolderName(CmsObject)
You can configure it in opencms-workplace.xml => categoryfolder.
See org.opencms.configuration.CmsWorkplaceConfiguration line 889.


I hope I could help you, but I have not tested :)  

Best Regards, Patric





-----Ursprüngliche Nachricht-----
Von: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] Im Auftrag von Christoph Fröhlich
Gesendet: Mittwoch, 2. Juli 2014 17:31
An: The OpenCms mailing list
Betreff: [opencms-dev] OpenCms9: Categories and Detail-Names get mixed up

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)


_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev






More information about the opencms-dev mailing list