diff --git a/VERSIONS_HOTLINE/72890 b/VERSIONS_HOTLINE/72890 new file mode 100644 index 0000000000000000000000000000000000000000..0b5813879842d3a3f8b22ba4159d054c0771c0ae --- /dev/null +++ b/VERSIONS_HOTLINE/72890 @@ -0,0 +1 @@ + - ticket #72890 : explorateur de fichiers : Bug sur la suppression de lien d'image vers article \ No newline at end of file diff --git a/application/modules/opac/controllers/RechercheController.php b/application/modules/opac/controllers/RechercheController.php index 12f4c025050f2a9b81d8ca96fdc37019ba3284b6..5fc055211997ee5986625e2ecef86aa2d69666bf 100644 --- a/application/modules/opac/controllers/RechercheController.php +++ b/application/modules/opac/controllers/RechercheController.php @@ -112,10 +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->getFrontController()->getRouter()->getCurrentRoute() - ->match(str_replace(BASE_URL, - '', - $this->view->url($criteres_recherche->getCriteres()))); + $this->_helper->addQuery($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 new file mode 100644 index 0000000000000000000000000000000000000000..6a291d0e6e252c5b2c546b9c34b8486f122c89d8 --- /dev/null +++ b/library/ZendAfi/Controller/Action/Helper/AddQuery.php @@ -0,0 +1,37 @@ +<?php +/** + * Copyright (c) 2012-2014, Agence Française Informatique (AFI). All rights reserved. + * + * BOKEH is free software; you can redistribute it and/or modify + * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by + * the Free Software Foundation. + * + * There are special exceptions to the terms and conditions of the AGPL as it + * is applied to this software (see README file). + * + * BOKEH is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE + * along with BOKEH; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + +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(); + + $this->getFrontController() + ->getRouter() + ->getCurrentRoute() + ->match(str_replace(BASE_URL, + '', + $view->url($params ? $params : $request->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 8c0217170fc63ae3a84bccb985c0cebf0071c5fd..88f1a2ae4b6892c7d2bcee1d556a9cef12688ce1 100644 --- a/library/ZendAfi/Controller/Plugin/Manager/Manager.php +++ b/library/ZendAfi/Controller/Plugin/Manager/Manager.php @@ -140,6 +140,8 @@ class ZendAfi_Controller_Plugin_Manager_Manager extends ZendAfi_Controller_Plugi if ($this->_response->isRedirect()) return; + $this->_helper->addQuery(); + if (!$model = $this->_findModel()) { $this->_redirectToIndex(); return; diff --git a/tests/application/modules/admin/controllers/CmsControllerTest.php b/tests/application/modules/admin/controllers/CmsControllerTest.php index 906e951e9cabee88faf3da4d54f32a5061cb77a0..85c8d47a4ad38e37dd0489830c2ab791ac5d4d12 100644 --- a/tests/application/modules/admin/controllers/CmsControllerTest.php +++ b/tests/application/modules/admin/controllers/CmsControllerTest.php @@ -2993,7 +2993,7 @@ class CmsControllerEditArticleWithDate30December2014Test extends CmsControllerte Class_Users::getIdentity()->setRoleLevel(ZendAfi_Acl_AdminControllerRoles::SUPER_ADMIN); - $this->dispatch('/admin/cms/edit/id/4'); + $this->dispatch('/admin/cms/edit/id/4', true); } @@ -3008,3 +3008,24 @@ class CmsControllerEditArticleWithDate30December2014Test extends CmsControllerte $this->assertXPath('//input[@checked="checked"][@value="1"]'); } } + + + + +class CmsControllerEditArticleWithQueryTest extends CmsControllertestCase { + + public function setup() { + parent::setup(); + $this->concert->setFin('2014-12-30'); + + Class_Users::getIdentity()->setRoleLevel(ZendAfi_Acl_AdminControllerRoles::SUPER_ADMIN); + + $this->dispatch('/admin/cms/edit?id=4', true); + } + + + /** @test */ + public function formActionShouldContainsId4() { + $this->assertXPath('//form[@action="/admin/cms/edit/id/4"]'); + } +} \ No newline at end of file