From 9fc55589303d9cb34453c7adda7541cca5f8d06c Mon Sep 17 00:00:00 2001 From: Tomasz Narloch Date: Wed, 31 Jan 2018 21:12:26 +0100 Subject: [PATCH] Revert "Regression at createUri from #19099 (#19415)" This reverts commit 128a4d467d3773463966c5634f3e4f5ba12bebe6. --- .../com_content/views/archive/tmpl/default.php | 4 +++- libraries/src/Router/SiteRouter.php | 7 ------- .../suites/libraries/cms/router/JRouterSiteTest.php | 12 ------------ 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/components/com_content/views/archive/tmpl/default.php b/components/com_content/views/archive/tmpl/default.php index c6b3e33b2984a..e46eae1bffce7 100644 --- a/components/com_content/views/archive/tmpl/default.php +++ b/components/com_content/views/archive/tmpl/default.php @@ -21,7 +21,7 @@ -
+

diff --git a/libraries/src/Router/SiteRouter.php b/libraries/src/Router/SiteRouter.php index 6dbabc1ea02a2..a7187f65f8aec 100644 --- a/libraries/src/Router/SiteRouter.php +++ b/libraries/src/Router/SiteRouter.php @@ -716,13 +716,6 @@ protected function createUri($url) { $uri->setVar('option', $option); } - - $itemid = $this->getVar('Itemid'); - - if ($itemid) - { - $uri->setVar('Itemid', $itemid); - } } } else diff --git a/tests/unit/suites/libraries/cms/router/JRouterSiteTest.php b/tests/unit/suites/libraries/cms/router/JRouterSiteTest.php index c2c91c1e9ceef..7e8656a32a603 100644 --- a/tests/unit/suites/libraries/cms/router/JRouterSiteTest.php +++ b/tests/unit/suites/libraries/cms/router/JRouterSiteTest.php @@ -1265,18 +1265,6 @@ public function casesCreateUri() 'preset' => array('option' => 'com_test'), 'expected' => 'index.php?var1=value1&option=com_test' ), - // Check if a URL with no Itemid and no option, but globally set Itemid is added the Itemid - array( - 'url' => 'index.php?var1=value1', - 'preset' => array('Itemid' => '42'), - 'expected' => 'index.php?var1=value1&Itemid=42' - ), - // Check if a URL with no Itemid and no option, but with an option and a global Itemid available, which fits the option of the menu item gets the Itemid and option appended - array( - 'url' => 'index.php?var1=value1', - 'preset' => array('Itemid' => '42', 'option' => 'com_test'), - 'expected' => 'index.php?var1=value1&option=com_test&Itemid=42' - ), ); }