From 631fb2367a7b2a539e29d3c23d0633736354e17a Mon Sep 17 00:00:00 2001 From: jensp Date: Tue, 13 Feb 2018 11:19:52 +0000 Subject: [PATCH] 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-94f89814c4df --- .../navigation/ui/CategoryComponent.java | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/ccm-navigation/src/com/arsdigita/navigation/ui/CategoryComponent.java b/ccm-navigation/src/com/arsdigita/navigation/ui/CategoryComponent.java index 686c598e6..e4dd974bd 100755 --- a/ccm-navigation/src/com/arsdigita/navigation/ui/CategoryComponent.java +++ b/ccm-navigation/src/com/arsdigita/navigation/ui/CategoryComponent.java @@ -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); }