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

hotline #143674 fix description_html setting usage for records widgets

parent eb97c90b
Branches
Tags
2 merge requests!4505hotline#147634 : pre-registration : mail sent now can use placeholders...,!4480hotline #143674 fix description_html setting usage for records widgets
Pipeline #17716 passed with stage
in 20 minutes and 4 seconds
- correctif #143674 : Magasin de thèmes : Le paramètre "Autoriser les balises HTML"
des boites notices est maintenant bien pris en compte.
\ No newline at end of file
......@@ -102,9 +102,7 @@ class Intonation_Library_View_Wrapper_Record extends Intonation_Library_View_Wra
$description = $xsl->isEnabled() && $this->getAllowXSL()
? $this->_view->Notice_Xsl($xsl)
: $this->_view->truncate($this->_model->getResume(),
['class' => 'model_description_' . get_class($this->_model)],
$description_length);
: $this->_truncate($this->_model->getResume());
return ($this->_description = $this->getBadges() . $description);
}
......
......@@ -83,7 +83,6 @@ class TemplatesRecordsWidgetTest extends Admin_AbstractControllerTestCase {
abstract class TemplateRecordsWithDescriptionAndUnimarcTest extends AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
public function setUp() {
......@@ -96,7 +95,7 @@ abstract class TemplateRecordsWithDescriptionAndUnimarcTest extends AbstractCont
['id' => 'fre', 'libelle' => 'Français']);
$notice_unimarc = (new Class_NoticeUnimarc_Fluent)
->zoneWithChildren('330', ['a' => 'La description s\'arrête ici et pas plus loin.'])
->zoneWithChildren('330', ['a' => 'La description s\'arrête ici et pas plus loin. <a href="/mon-super-lien">mon super lien</a>'])
->zoneWithChildren('210', ['c' => 'Auzou'])
->zoneWithChildren('225', ['a' => 'Pocket'])
->zoneWithChildren('101', ['a' => 'fre']);
......@@ -1411,4 +1410,34 @@ class TemplatesRecordWithMultipleMoreDescriptionDataTest extends AbstractControl
$this->assertXPathContentContains('//dl/dt[text()="Public"]/following-sibling::dd//ul//li//span[@class="more_description_data_title font-italic"]',
'Jeunesse');
}
}
class TemplatesRecordsWithAnchorInDescriptionTest extends TemplateRecordsWithDescriptionAndUnimarcTest {
public function setUp() {
parent::setUp();
$profile_patcher = (new Class_Template_ProfilePatcher(null))
->setProfile(Class_Profil::find(34));
$profile_patcher
->addWidget(Intonation_Library_Widget_Carousel_Record_Definition::CODE,
Class_Profil::DIV_MAIN,
['rendering' => 'card-description',
'layout' => 'list',
'size' => '1',
'description_html' => '1',
'description_length' => 1000]);
$this->dispatch('/opac/widget/render/widget_id/1/profile_id/34');
}
/** @test */
public function anchorBlablaShouldBeDisplay() {
$this->assertXPathContentContains('//div[contains(@class, "kiosque widget")]//p[@class= "model_description_Class_Notice"]//a',
'mon super lien');
}
}
\ No newline at end of file
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