<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 the records:<div><br></div><div>we fixed this issues for us by extending CmsDefaultLinkSubstitutionHandler</div><div><br></div><div>This is our class:</div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"><span style="color: #931a68">-----------------------------------</span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"><span style="color: #931a68">package</span> f3.cms.staticexport;</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; min-height: 15px;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"><span style="color: #931a68">import</span> org.opencms.file.CmsObject;</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"><span style="color: #931a68">import</span> org.opencms.staticexport.CmsDefaultLinkSubstitutionHandler;</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; min-height: 15px;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(79, 118, 203);"><span style="color: rgb(147, 26, 104);">public</span> <span style="color: rgb(147, 26, 104);">class</span> F3LinkSubstitutionHandler <span style="color: rgb(147, 26, 104);">extends</span> CmsDefaultLinkSubstitutionHandler {</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; min-height: 15px;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;">    <span style="color: rgb(119, 119, 119);">@Override</span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;">    <span style="color: #931a68">public</span> String getRootPath(CmsObject cms, String targetUri, String basePath) {</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; min-height: 15px;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;">        String result = getSimpleRootPath(cms, targetUri, basePath);</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;">        <span style="color: #931a68">if</span> (result == <span style="color: #931a68">null</span>) {</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;">            result = <span style="color: #931a68">super</span>.getRootPath(cms, targetUri, basePath);</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;">        }</div><div style="margin: 0px; font-size: 11px; font-family: Monaco;">        <span style="color: #931a68">return</span> result;</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; min-height: 15px;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;">    }</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; min-height: 15px;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;">}</div><div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"><span style="color: rgb(147, 26, 104);">-----------------------------------</span></div><div><span style="color: rgb(147, 26, 104);"><br></span></div><div><br></div><div>and configured it in opencms-importexport.xml</div><span class="Apple-tab-span" style="white-space:pre">       </span></div><div><span class="Apple-tab-span" style="white-space:pre">     </span><linksubstitutionhandler>f3.cms.staticexport.F3LinkSubstitutionHandler</linksubstitutionhandler><br></div><div><span class="Apple-tab-span" style="white-space:pre"><span style="white-space: normal;"><br></span></span></div><div><span class="Apple-tab-span" style="white-space:pre"><span style="white-space: normal;">Regards</span></span></div><div><span class="Apple-tab-span" style="white-space:pre"><span style="white-space: normal;"><br></span></span></div><div><span class="Apple-tab-span" style="white-space:pre"><span style="white-space: normal;">c</span></span></div><div><span class="Apple-tab-span" style="white-space:pre"><span style="white-space: normal;"><br></span></span></div><div><span class="Apple-tab-span" style="white-space:pre">          </span><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>[opencms-dev] Fwd: 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';">4. Juli 2014 13:46:02 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><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"><div 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;"><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;"><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;"><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;"><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;"><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><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 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></div>_______________________________________________<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>