Skip to content
Snippets Groups Projects
Commit d578bf35 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

hotline #155404 fix journal rendering with deleted articles

parent 19e1e9a6
Branches
Tags
1 merge request!4423hotline #155404 fix journal rendering with deleted articles
Pipeline #17083 passed with stage
in 42 minutes and 41 seconds
- correctif #155404 : Administration : correction de l'affichage du journal lorsque des articles ont été supprimés.
\ No newline at end of file
......@@ -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',
......
......@@ -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');
}
}
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