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

Merge branch 'hotline#30329_handle_empty_attributes_in_record_print' into 'hotline-master'

Hotline#30329 handle empty attributes in record print

See merge request !1180
parents c31edfdd c0971057
Branches
Tags
No related merge requests found
- ticket #30329 : Corrige l'affichage en mode impression lorsque le modèle a une propriété vide.
\ No newline at end of file
......@@ -144,8 +144,7 @@ class Class_ModeleFusion extends Storm_Model_Abstract {
foreach ($matches as $match) {
$tag = array_shift($match);
if (!$tag_value = $this->getTagValueForString($match))
continue;
$tag_value = $this->getTagValueForString($match);
$content = str_replace($tag, $tag_value, $content);
}
......
......@@ -67,7 +67,7 @@ class RechercheControllerPrintActionWithRecordsTest extends AbstractControllerTe
$this->fixture('Class_ModeleFusion', ['id' => 1,
'nom' => 'recherche',
'contenu' => '<p> {notices.each[<img src="{url_vignette}"/> <h1>{titre_principal}</h1> <div>{article.contenu}</div>
'contenu' => '<p> {notices.each[<img src="{url_vignette}"/> <h1>{titre_principal}</h1> <div>{article.contenu}</div> <div>{resume}</div>
]}</p>']);
Class_Indexation_PseudoNotice::index( $this->fixture('Class_Article' , ['id' => 10,
......@@ -118,7 +118,10 @@ class RechercheControllerPrintActionWithRecordsTest extends AbstractControllerTe
}
/** @test */
public function displayShouldNotPrintTagResume() {
$this->assertNotXPathContentContains("//div", '{resume}');
}
}
......@@ -134,6 +137,7 @@ class RechercheControllerViewNoticePrintActionWithRecordsTest extends AbstractCo
$this->fixture('Class_ModeleFusion', ['id' => 1,
'nom' => 'article',
'contenu' => '<p><h1> {notice.titre_principal}</h1> <div>{notice.article.contenu} </div>
<div>{notice.resume} </div>
{notice.avis[<p>{avis}</p>]}
</p>',
'type' => 'Notice_View']);
......@@ -189,4 +193,10 @@ class RechercheControllerViewNoticePrintActionWithRecordsTest extends AbstractCo
public function avisShouldBeDisplayed() {
$this->assertXPathContentContains('//div//p', "Lies are news and truth is obsolete.",$this->_response->getBody());
}
/** @test */
public function displayShouldNotPrintNoticeDotResume() {
$this->assertNotXPathContentContains("//div", '{notice.resume}');
}
}
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