Skip to content
Snippets Groups Projects
Commit 031a06ad authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

Merge branch 'hotline#68975_retour_sur_les_articles_probleme_de_cheminement' into 'stable'

hotline #68975 fix article back button after save

See merge request !2458
parents ee020ba5 a31a59b1
Branches
Tags
3 merge requests!2464Master,!2463Hotline master,!2458hotline #68975 fix article back button after save
Pipeline #3248 failed with stage
in 27 minutes and 13 seconds
- ticket #68975 : Retour sur les articles en mode liste après sauvegarde : correction de retour sur la catégorie de l'article
\ No newline at end of file
......@@ -67,7 +67,14 @@ class Admin_CmsController extends ZendAfi_Controller_Action {
$this->identity->isRoleLibraryLimited()
? $this->_bib->getId()
: null);
$id_cat = $this->_getParam('id_cat', 0);
$article = ($id_article = $this->_getParam('id', null))
? Class_Article::find($id_article)
: null;
$id_cat = $article
? $article->getIdCat()
: $this->_getParam('id_cat', 0);
$params = ['page' => $this->_getParam('page', 0),
'search_value' => $search,
......
......@@ -366,6 +366,7 @@ class CmsControllerListModeAdminBibSearchTest extends CmsControllerListModeTestC
'order' => 'titre',
'limitPage' => [0, 25]])
->answers([Class_Article::find(1)])
->whenCalled('countBy')
->with(['where' => '(titre like \'%news%\')',
'id_cat' => [1,23,34],
......@@ -377,19 +378,19 @@ class CmsControllerListModeAdminBibSearchTest extends CmsControllerListModeTestC
$this->dispatch('/admin/cms/index/title_search/news', true);
}
/** @test */
public function upButtonInTitleShouldBeUrlWithOrderTitle() {
$this->assertXPath('//th//a[contains(@href,"/admin/cms/index/title_search/news/order/titre")]',$this->_response->getBody());
}
/** @test */
/** @test */
public function downButtonInTitleShouldBeUrlWithOrderTitleDesc() {
$this->assertXPath('//th//a[contains(@href,"/admin/cms/index/title_search/news/order/titre+desc")]',$this->_response->getBody());
}
/** @test */
public function newsFromPortailShouldNotBePresent() {
$this->assertNotXPathContentContains('//td', 'News from portail');
......@@ -509,3 +510,19 @@ class CmsControllerListModeSearchPostFormTest extends CmsControllerListModeTestC
$this->assertRedirectTo('/admin/cms/index/title_search/abc/order/date_maj/status_search/1');
}
}
class CmsControllerListModeBackToIndexFromArticlesConcertTest extends CmsControllerListModeTestCase {
public function setUp() {
parent::setUp();
$this->dispatch('/admin/cms/index/id/4', true);
}
/** @test */
public function breadCrumbShouldDisplayCategoryEvents() {
$this->assertXPathContentContains('//div[@class="breadcrumb"]//a[contains(@href, "id_cat/34")]', 'Evènements');
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment