A bugfix for CategoryComponent. In some cases the URL provided to CategoryComponent ends with a slash in others in doesn't. Both cases are now supported.
git-svn-id: https://svn.libreccm.org/ccm/trunk@5269 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
59a5764863
commit
631fb2367a
|
|
@ -65,13 +65,22 @@ public abstract class CategoryComponent extends AbstractComponent {
|
|||
}
|
||||
content.addAttribute("description", description);
|
||||
if (CMSConfig.getInstanceOf().getUseLanguageExtension()
|
||||
&& !url.startsWith("/redirect/")) {
|
||||
content.addAttribute("url",
|
||||
String.format("%sindex.%s",
|
||||
url,
|
||||
GlobalizationHelper
|
||||
.getNegotiatedLocale()
|
||||
.getLanguage()));
|
||||
&& !url.startsWith("/redirect/")) {
|
||||
if (url.endsWith("/")) {
|
||||
content.addAttribute("url",
|
||||
String.format("%sindex.%s",
|
||||
url,
|
||||
GlobalizationHelper
|
||||
.getNegotiatedLocale()
|
||||
.getLanguage()));
|
||||
} else {
|
||||
content.addAttribute("url",
|
||||
String.format("%s/index.%s",
|
||||
url,
|
||||
GlobalizationHelper
|
||||
.getNegotiatedLocale()
|
||||
.getLanguage()));
|
||||
}
|
||||
} else {
|
||||
content.addAttribute("url", url);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue