Skip to content
Snippets Groups Projects
Commit 246ca5cc authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

dev #48349 : fix empty multicheckbox customfield comparison

parent b82dc6cc
Branches
Tags
2 merge requests!2334Master,!2104Dev#48349 ux versionning
Pipeline #1085 passed with stage
in 11 minutes and 22 seconds
......@@ -147,7 +147,7 @@ class ZendAfi_Form_Admin_CustomFields_ModelValues_Field_Strategy_multiCheckbox e
public function unserialize($value) {
return explode(';', $value);
return $value ? explode(';', $value) : [];
}
}
......
......@@ -37,7 +37,8 @@ class ZendAfi_Form_Decorator_VersionCompare extends Zend_Form_Decorator_Abstract
protected function _renderLabel() {
return $this->_tag('td',
$this->_tag('label', $this->getElement()->getLabel()),
$this->_tag('label', $this->getElement()->getLabel(),
['for' => $this->getElement()->getName()]),
['class' => 'droite']);
}
......
......@@ -46,6 +46,13 @@ abstract class VersionningAdminTestCase extends Admin_AbstractControllerTestCase
'id_cat' => 33,
'debut' => '2017-03-23',
'events_debut' => '2017-03-23 16:00:00']);
$this->fixture('Class_CustomField',
['id' => 133,
'label' => 'Public',
'field_type' => Class_CustomField_Meta::MULTI_CHECKBOX,
'options_list' => 'Jeunesse;Petite enfance;Adulte',
'model' => 'Article']);
}
......@@ -209,6 +216,13 @@ class VersionningArticleVersionTest extends VersionningAdminTestCase {
}
/** @test */
public function publicCustomFieldShouldNotBeMarkedAsModified() {
$this->assertNotXPathContentContains('//tr[@class="modified"]//label[@for="field_133"]', 'Public',
$this->_response->getBody());
}
/** @test */
public function previousButtonShouldBePresent() {
$this->assertXPathContentContains('//button[contains(@data-url, "/version/id/27/key/2017-03-19_103345_32")]',
......
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