diff --git a/VERSIONS_HOTLINE/30329 b/VERSIONS_HOTLINE/30329 new file mode 100644 index 0000000000000000000000000000000000000000..1bedd030b139f6c213c4593157d39cab024ca3b1 --- /dev/null +++ b/VERSIONS_HOTLINE/30329 @@ -0,0 +1 @@ + - ticket #30329 : Corrige l'affichage en mode impression lorsque le modèle a une propriété vide. \ No newline at end of file diff --git a/library/Class/ModeleFusion.php b/library/Class/ModeleFusion.php index 508e0338662e6121129897c119e0998ae6afab2b..b5d7728f6e9a7ae1752ab7a1bd7562d533033271 100644 --- a/library/Class/ModeleFusion.php +++ b/library/Class/ModeleFusion.php @@ -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); } diff --git a/tests/application/modules/opac/controllers/RechercheControllerPrintActionTest.php b/tests/application/modules/opac/controllers/RechercheControllerPrintActionTest.php index 8fe479988c796c7737df0f53b4d812e5b33ea559..a79c352713387dbd46a0b91806fffd713a5c7a65 100644 --- a/tests/application/modules/opac/controllers/RechercheControllerPrintActionTest.php +++ b/tests/application/modules/opac/controllers/RechercheControllerPrintActionTest.php @@ -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}'); + } }