diff --git a/application/modules/opac/controllers/RechercheController.php b/application/modules/opac/controllers/RechercheController.php index 5fc055211997ee5986625e2ecef86aa2d69666bf..5c7b3423157387a6ecb88445987d045d085b3fe3 100644 --- a/application/modules/opac/controllers/RechercheController.php +++ b/application/modules/opac/controllers/RechercheController.php @@ -112,7 +112,7 @@ class RechercheController extends ZendAfi_Controller_Action { && !$criteres_recherche->ownedBy(Class_Users::getIdentity())) return $this->_redirect('opac/auth/login?redirect=' . urlencode(Class_Url::absolute($this->view->url()))); - $this->_helper->addQuery($criteres_recherche->getCriteres()); + $this->_helper->addQuery($this->view, $criteres_recherche->getCriteres()); $this->_runSearchAndRender($criteres_recherche); } diff --git a/library/ZendAfi/Controller/Action/Helper/AddQuery.php b/library/ZendAfi/Controller/Action/Helper/AddQuery.php index 6a291d0e6e252c5b2c546b9c34b8486f122c89d8..abf52755d86ccf7775fd3690e342746b369a6521 100644 --- a/library/ZendAfi/Controller/Action/Helper/AddQuery.php +++ b/library/ZendAfi/Controller/Action/Helper/AddQuery.php @@ -22,16 +22,12 @@ class ZendAfi_Controller_Action_Helper_AddQuery extends Zend_Controller_Action_Helper_Abstract { - public function direct(array $params = []) { - $action_controller = $this->getActionController(); - $view = $action_controller->view; - $request = $action_controller->getRequest(); - + public function direct($view, array $params = []) { $this->getFrontController() ->getRouter() ->getCurrentRoute() ->match(str_replace(BASE_URL, '', - $view->url($params ? $params : $request->getQuery()))); + $view->url($params ? $params : $this->getRequest()->getQuery()))); } } \ No newline at end of file diff --git a/library/ZendAfi/Controller/Plugin/Manager/Manager.php b/library/ZendAfi/Controller/Plugin/Manager/Manager.php index 88f1a2ae4b6892c7d2bcee1d556a9cef12688ce1..f7ea6550a77db96850e9e1b78a665b9b586d364c 100644 --- a/library/ZendAfi/Controller/Plugin/Manager/Manager.php +++ b/library/ZendAfi/Controller/Plugin/Manager/Manager.php @@ -140,7 +140,7 @@ class ZendAfi_Controller_Plugin_Manager_Manager extends ZendAfi_Controller_Plugi if ($this->_response->isRedirect()) return; - $this->_helper->addQuery(); + $this->_helper->addQuery($this->_view); if (!$model = $this->_findModel()) { $this->_redirectToIndex(); diff --git a/tests/application/modules/opac/controllers/RechercheControllerTest.php b/tests/application/modules/opac/controllers/RechercheControllerTest.php index f71b3af9aa467a367e0845cfff12a19f0256d03a..13cd4d2015e81d3f6e26557d667013357c46f868 100644 --- a/tests/application/modules/opac/controllers/RechercheControllerTest.php +++ b/tests/application/modules/opac/controllers/RechercheControllerTest.php @@ -1234,6 +1234,12 @@ class RechercheAvanceeControllerSimpleActionWithDefaultConfigTest extends Recher } + /** @test */ + public function pageShouldContainsRechTitresMaupassantWrappedInSlahes() { + $this->assertXPath('//a[contains(@href, "/rech_titres/maupassant")]'); + } + + /** @test */ public function userSettingBookmarkedDomainShouldBeOne() { $this->assertEquals(1,