<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">For all who are interested in this bug I created an issue on github<div><br></div><div><a href="https://github.com/alkacon/opencms-core/issues/268">https://github.com/alkacon/opencms-core/issues/268</a></div><div><br></div><div>I also added a jsp which allows you to reproduce the bug.</div><div><br></div><div>Regards</div><div>Christoph</div><div><br><div><br><div>Anfang der weitergeleiteten Nachricht:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; color:rgba(0, 0, 0, 1.0);"><b>Von: </b></span><span style="font-family:'Helvetica';">Christoph Fröhlich <<a href="mailto:cfauto@folge2.de">cfauto@folge2.de</a>><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; color:rgba(0, 0, 0, 1.0);"><b>Betreff: </b></span><span style="font-family:'Helvetica';"><b>Aw: [opencms-dev] OpenCms9: Categories and Detail-Names get mixed up</b><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; color:rgba(0, 0, 0, 1.0);"><b>Datum: </b></span><span style="font-family:'Helvetica';">3. Juli 2014 16:16:53 MESZ<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; color:rgba(0, 0, 0, 1.0);"><b>An: </b></span><span style="font-family:'Helvetica';">The OpenCms mailing list <<a href="mailto:opencms-dev@opencms.org">opencms-dev@opencms.org</a>><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; color:rgba(0, 0, 0, 1.0);"><b>Antwort an: </b></span><span style="font-family:'Helvetica';">The OpenCms mailing list <<a href="mailto:opencms-dev@opencms.org">opencms-dev@opencms.org</a>><br></span></div><br><div>Hi Patric,<br><br>thanks for your support. I'm answering inline<br><br>Am 03.07.2014 um 10:24 schrieb Patric Dosch <<a href="mailto:patric.dosch@virtual-identity.com">patric.dosch@virtual-identity.com</a>>:<br><br><blockquote type="cite">Hey Christoph, <br><br>now I have better understood the problem. Unfortunately, I do not the answer.<br><br><%= OpenCms.getLinkManager().getRootPath(cms, "/.categories/news/category/financial-press/") %><br><%= OpenCms.getLinkManager().getRootPath(cms, "/.categories/section/") %><br><br>That works for me, even if I take a category that is called as a content type (section).<br><br></blockquote>The problem only arises if there is a matching detail name. If you have a section with a detail name of "financial-press" then<br>the line<br><%= OpenCms.getLinkManager().getRootPath(cms, "/.categories/news/category/financial-press/") %><br><br>would return <br>"/sites/default/.categories/section/financial-press/"<br><br>Which means that you ask for the root path of particular resource and a totally different resource is returned<br><br><br><blockquote type="cite">A question, for which you need the rootpath with /sites/default/ for a category?<br><br></blockquote>I don't call it explicitly but CmsCategoryWidget uses it implicitly. The calls are in org.opencms.xml.types.CmsXmlCategoryValue / org.opencms.xml.types.CmsXmlVfsFileValue.<br><br>Regards<br>c<br><br><br><br><br><blockquote type="cite">Regards, Patric<br><br><br>-----Ursprüngliche Nachricht-----<br>Von: <a href="mailto:opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.org</a> [<a href="mailto:opencms-dev-bounces@opencms.org">mailto:opencms-dev-bounces@opencms.org</a>] Im Auftrag von Christoph Fröhlich<br>Gesendet: Mittwoch, 2. Juli 2014 19:50<br>An: The OpenCms mailing list<br>Betreff: Re: [opencms-dev] OpenCms9: Categories and Detail-Names get mixed up<br><br>Hi Patric,<br><br>thanks for the hint. I didn't know about the new basename, but we had set the old one in opencms-workplace.xml and this overwrites the setting in CmsCategoryService.<br>At least as far as I understand the code. Nevertheless I changed the basename in workplace and in opencms-workplace.xml to "/.categories" but unfortunately with no effect.<br><br>To narrow my problem down<br>1) We have an arbitrary xml content. Lets say "/.content/articles/foo" with the detail name "foo"<br>2) We have a category with a similar name. Lets say "/_categories/maincategory/foo"<br>3) When we call <br><span class="Apple-tab-span" style="white-space:pre"> </span>OpenCms.getLinkManager().getRootPath(cms, "/_categories/maincategory/foo"); it returns<br><span class="Apple-tab-span" style="white-space:pre"> </span>"/sites/default/.content/articles/foo"<br>and not <br><span class="Apple-tab-span" style="white-space:pre"> </span>"/sites/default/_categories/maincategory/foo"<br><br>If this is meaningful behavior, it is beyond my understanding :) If someone else did encounter this and knows about a workaround, I would be really grateful for some advice<br><br><br>Thanks and regards<br>Christoph<br>Am 02.07.2014 um 18:18 schrieb Patric Dosch <<a href="mailto:patric.dosch@virtual-identity.com">patric.dosch@virtual-identity.com</a>>:<br><br><blockquote type="cite">Hey Christoph,<br><br>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". <br>public static final String REPOSITORY_BASE_FOLDER = "/.categories /." <br>in org.opencms.relations.CmsCategoryService<br><br>I think this has solved my problems. But it was only a test and not a real project.<br><br><br>Oh maybe here <br>org.opencms.relations.CmsCategoryService.getRepositoryBaseFolderName(C<br>msObject) You can configure it in opencms-workplace.xml => <br>categoryfolder.<br>See org.opencms.configuration.CmsWorkplaceConfiguration line 889.<br><br><br>I hope I could help you, but I have not tested :)<br><br>Best Regards, Patric<br><br><br><br><br><br>-----Ursprüngliche Nachricht-----<br>Von: <a href="mailto:opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.org</a> <br>[<a href="mailto:opencms-dev-bounces@opencms.org">mailto:opencms-dev-bounces@opencms.org</a>] Im Auftrag von Christoph <br>Fröhlich<br>Gesendet: Mittwoch, 2. Juli 2014 17:31<br>An: The OpenCms mailing list<br>Betreff: [opencms-dev] OpenCms9: Categories and Detail-Names get mixed <br>up<br><br>Dear all,<br><br>after migrating a major installation from OpenCms 8 to 9 there are some categories that can not be saved in a content type anymore.<br><br>The underlying problem is that OpenCms9 takes a category with the name<br><span class="Apple-tab-span" style="white-space:pre"> </span>"/_categories/Fach-Kategorien/Interkulturelle-Arbeit/"<br><br>erroneously for an article with a similar name<br><span class="Apple-tab-span" style="white-space:pre"> </span>"/sites/default/.content/articleprof/migration-interkulturelle-arbeit.html"<br><br><br>The problematic code is on line 295 of<br>---------------------------------------------------<br>org.opencms.xml.types.CmsXmlCategoryValue.setStringValue(CmsObject, <br>String)<br>---------------------------------------------------<br><br><br>It reads: <br>---------------------------------------------------<br>path = OpenCms.getLinkManager().getRootPath(cms, path);<br>---------------------------------------------------<br><br>It translates "path" from<br>"/_categories/Fach-Kategorien/Interkulturelle-Arbeit/"<br>to<span class="Apple-tab-span" style="white-space:pre"> </span><br>"/sites/default/.content/articleprof/migration-interkulturelle-arbeit.html"<br><br><br>The translation seems to be a new "feature" of LinkManager, who tries too avidly finding a detail url where none is desired.<br><br>This seems to be a major problem to us, since we use categories heavily in this installation.<br><br>Furthermore I'm a bit scared about this bug. LinkManager.getRootPath() seems to be a widely used method and this behavior is rather unpredictable. <br>I could replace LinkManager with a custom implementation but I do not overview in which situation the current behavior may make sense.<br><br>Did others encounter this bug as well? Did you manage to workaround it?<br><br><br>Thanks and regards<br><br>Christoph<br><br><br><br>PS<br>The bug happens in the old StandardEditor as well as in the new Acacia-Editor. <br>And it is totally agnostic to whether we configure the field as <br>"OpenCmsCategory" or as "OpenCmsVfsFile" (CmsXmlVfsFileValue uses the <br>same call to LinkManager)<br><br><br>_______________________________________________<br>This mail is sent to you from the opencms-dev mailing list To change <br>your list options, or to unsubscribe from the list, please visit <br><a href="http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev">http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev</a><br><br><br><br>_______________________________________________<br>This mail is sent to you from the opencms-dev mailing list To change <br>your list options, or to unsubscribe from the list, please visit <br>http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev<br><br><br><br></blockquote><br>_______________________________________________<br>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 <a href="http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev">http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev</a><br><br><br><br>_______________________________________________<br>This mail is sent to you from the opencms-dev mailing list<br>To change your list options, or to unsubscribe from the list, please visit<br><a href="http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev">http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev</a><br><br><br><br></blockquote><br>_______________________________________________<br>This mail is sent to you from the opencms-dev mailing list<br>To change your list options, or to unsubscribe from the list, please visit<br><a href="http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev">http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev</a><br><br><br><br></div></blockquote></div><br></div></body></html>