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

hotline #74120 fix rt comments

parent 7992de09
Branches
Tags
2 merge requests!2660Master,!2604hotline #74120 fix doc type selector in search widget
Pipeline #3927 failed with stage
in 34 minutes and 56 seconds
......@@ -24,7 +24,7 @@ class ZendAfi_View_Helper_ComboCodification extends ZendAfi_View_Helper_BaseHelp
const SECTION = 'section';
public function ComboCodification($type, $valeur_select, $events = '') {
if(!$valeur_select)
if(null === $valeur_select)
$valeur_select = [];
if(!is_array($valeur_select))
......@@ -64,7 +64,7 @@ class ZendAfi_View_Helper_ComboCodification extends ZendAfi_View_Helper_BaseHelp
$combo = '<select id="' . $id . '" name="' . $name . '"' . $events . ' class="typeDoc">';
foreach ($items as $item) {
$selected = $item['value'] == reset($valeur_select) ? ' selected="selected"': '';
$selected = $item['value'] === reset($valeur_select) ? ' selected="selected"': '';
$combo .= '<option value="' . $item["value"] . '"' . $selected.'>' . stripSlashes($item["libelle"]) . '</option>';
}
$combo .= '</select>';
......
......@@ -398,6 +398,7 @@ class ZendAfi_View_Helper_TagRechercheSimpleDocTypeTest extends ZendAfi_View_Hel
$this->preferences['type_doc'] = '';
$this->_html = $this->_helper->tagRechercheSimple($this->preferences, 1);
$this->assertXPathContentContains($this->_html, '//option[@value=""][@selected]', 'tous');
$this->assertXPathContentContains($this->_html, '//option[@value="0"][not(@selected)]', 'Non identifi');
}
......@@ -414,5 +415,6 @@ class ZendAfi_View_Helper_TagRechercheSimpleDocTypeTest extends ZendAfi_View_Hel
$this->preferences['type_doc'] = '0';
$this->_html = $this->_helper->tagRechercheSimple($this->preferences, 1);
$this->assertXPathContentContains($this->_html, '//option[@value="0"][@selected]', 'Non identifi');
$this->assertXPathContentContains($this->_html, '//option[@value=""][not(@selected)]', 'tous');
}
}
\ 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