diff --git a/application/modules/opac/controllers/BibController.php b/application/modules/opac/controllers/BibController.php index 97c0a5f3aefb8fef50bfd78d3cfbb4d83d6660c4..b444b8d60f11ec268a1b0dc34b57489aa55d5229 100644 --- a/application/modules/opac/controllers/BibController.php +++ b/application/modules/opac/controllers/BibController.php @@ -99,7 +99,9 @@ class BibController extends ZendAfi_Controller_Action { if(false === strpos($this->_getReferer(), '/recherche/simple')) return $this->_redirectToReferer(); - return $this->_redirectToRefererWithNewParams(['bib_select' => implode(',',$this->view->id_bibs_session)]); + $bib_select = implode(',',$this->view->id_bibs_session); + return $this->_redirectToRefererWithNewParams(['bib_select' => ($bib_select === '' + ? null : $bib_select)]); } } diff --git a/tests/application/modules/opac/controllers/BibControllerTest.php b/tests/application/modules/opac/controllers/BibControllerTest.php index 3fd563ba35815a1be25a4cdf8dc37878cfb7fe7b..8d62fa98f2e0d2572123842d6258381eeb94e68e 100644 --- a/tests/application/modules/opac/controllers/BibControllerTest.php +++ b/tests/application/modules/opac/controllers/BibControllerTest.php @@ -506,7 +506,7 @@ class BibControllerBibSelectionPostDispatchTest extends BibControllerSelectionTe class BibControllerBibSelectionUnselectPostDispatch extends BibControllerSelectionTestCase { public function setUp() { parent::setUp(); - $_SERVER['HTTP_REFERER'] = 'http://mybokeh.org'; + $_SERVER['HTTP_REFERER'] = 'http://mybokeh.org/recherche/simple/expressionRecherche/pomme/bib_select/2'; $this->postDispatch('bib/selection', ['update_bib_select' => 1]); } @@ -520,11 +520,6 @@ class BibControllerBibSelectionUnselectPostDispatch extends BibControllerSelecti public function sessionShouldNotContainsCasablancaAndCairo() { $this->assertEquals([] , $this->_session->id_bibs); } - - /** @test */ - public function shouldRedirectToRefererWithNewParams() { - $this->assertRedirectTo('http://mybokeh.org'); - } }