From 5af3c90109532a8e92c9da0d900852fe17e713b4 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Wed, 4 Dec 2013 08:15:58 +0100 Subject: [PATCH] # [#32868] Trashed categories create a fatal error when creating URLs to them, URLs to contact categories are wrong. Thanks Hannes Papenberg (Fix #2636) --- components/com_contact/helpers/route.php | 4 ++-- components/com_newsfeeds/helpers/route.php | 2 +- components/com_weblinks/helpers/route.php | 3 ++- installation/CHANGELOG | 3 +++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/components/com_contact/helpers/route.php b/components/com_contact/helpers/route.php index d8ab88609488c..fb1db131a6849 100644 --- a/components/com_contact/helpers/route.php +++ b/components/com_contact/helpers/route.php @@ -66,7 +66,7 @@ public static function getCategoryRoute($catid) $category = JCategories::getInstance('Contact')->get($id); } - if($id < 1) + if ($id < 1 || !($category instanceof JCategoryNode)) { $link = ''; } @@ -83,7 +83,7 @@ public static function getCategoryRoute($catid) if ($item = self::_findItem($needles)) { - $link = 'index.php?Itemid='.$item; + $link .= '&Itemid='.$item; } } diff --git a/components/com_newsfeeds/helpers/route.php b/components/com_newsfeeds/helpers/route.php index 0ef9628cb791e..9dd90830e6438 100644 --- a/components/com_newsfeeds/helpers/route.php +++ b/components/com_newsfeeds/helpers/route.php @@ -68,7 +68,7 @@ public static function getCategoryRoute($catid) $category = JCategories::getInstance('Newsfeeds')->get($id); } - if($id < 1) + if ($id < 1 || !($category instanceof JCategoryNode)) { $link = ''; } diff --git a/components/com_weblinks/helpers/route.php b/components/com_weblinks/helpers/route.php index d3cbd39b8d273..e8a0183312b6d 100644 --- a/components/com_weblinks/helpers/route.php +++ b/components/com_weblinks/helpers/route.php @@ -86,7 +86,8 @@ public static function getCategoryRoute($catid) $category = JCategories::getInstance('Weblinks')->get($id); } - if ($id < 1) { + if ($id < 1 || !($category instanceof JCategoryNode)) + { $link = ''; } else { diff --git a/installation/CHANGELOG b/installation/CHANGELOG index 448c3fba8742f..bec23b45a26ab 100644 --- a/installation/CHANGELOG +++ b/installation/CHANGELOG @@ -26,6 +26,9 @@ $ -> Language fix or change - -> Removed ! -> Note +04-Dec-2013 Jean-Marie Simonet + # [#32868] Trashed categories create a fatal error when creating URLs to them, URLs to contact categories are wrong. Thanks Hannes Papenberg + 26-Nov-2013 Jean-Marie Simonet # [#32812] *Wrong JText causes double string use