diff --git a/VERSIONS_HOTLINE/155404 b/VERSIONS_HOTLINE/155404 new file mode 100644 index 0000000000000000000000000000000000000000..8f10a5a598b633a0b02246ce79b839d02d60e370 --- /dev/null +++ b/VERSIONS_HOTLINE/155404 @@ -0,0 +1 @@ + - correctif #155404 : Administration : correction de l'affichage du journal lorsque des articles ont été supprimés. \ No newline at end of file diff --git a/library/Class/Journal/ArticleType.php b/library/Class/Journal/ArticleType.php index 8d19f3b23b3935f10c4a3317f65a91ca93297664..e46db57b6fb9e1e0bd5e11a8585d69582abaf204 100644 --- a/library/Class/Journal/ArticleType.php +++ b/library/Class/Journal/ArticleType.php @@ -43,7 +43,9 @@ class Class_Journal_ArticleType extends Class_Journal_Type { public function renderModelLinkOn($id, Zend_View_Interface $view) : string { - $article = Class_Article::find($id); + if ( ! $article = Class_Article::find($id)) + return $this->_('inconnu id: %d', $id); + return $view->tagAnchor(['module' => 'admin', 'controller' => 'cms', 'action' => 'edit', diff --git a/tests/scenarios/Journal/JournalTest.php b/tests/scenarios/Journal/JournalTest.php index 7a7fb2dfc60e9f36159ff811d0e3b42ab266a4c5..8d413b448ee0615ad380a236aec9f625f7a54168 100644 --- a/tests/scenarios/Journal/JournalTest.php +++ b/tests/scenarios/Journal/JournalTest.php @@ -308,3 +308,16 @@ class JournalErrorsTest extends JournalTestCase { $this->assertRedirectTo('/admin/journal/index'); } } + + + + +class JournalWithDeletedArticleTest extends JournalWithEntriesTestCase { + + /** @test */ + public function journalShouldRenderTable() { + Class_Article::find(2)->delete(); + $this->dispatch('/admin/journal'); + $this->assertXPathContentContains('//table//td', 'a modifié l\'article inconnu id: 2'); + } +}