Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed May 31, 2019
1 parent b46b675 commit cd75794
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions htdocs/core/class/extrafields.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1861,7 +1861,7 @@ function showSeparator($key, $object)
function setOptionalsFromPost($extralabels, &$object, $onlykey='')
{
global $_POST, $langs;
$nofillrequired='';// For error when required field left blank
$nofillrequired=0;// For error when required field left blank
$error_field_required = array();

if (is_array($this->attributes[$object->table_element]['label'])) $extralabels=$this->attributes[$object->table_element]['label'];
Expand Down Expand Up @@ -1892,7 +1892,8 @@ function setOptionalsFromPost($extralabels, &$object, $onlykey='')
if ($this->attributes[$object->table_element]['required'][$key]) // Value is required
{
// Check if empty without using GETPOST, value can be alpha, int, array, etc...
if ((! is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $_POST["options_".$key] != '0')
if ((! is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] != 'select' && $_POST["options_".$key] != '0')
|| (! is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] == 'select')
|| (is_array($_POST["options_".$key]) && empty($_POST["options_".$key])))
{
//print 'ccc'.$value.'-'.$this->attributes[$object->table_element]['required'][$key];
Expand Down

0 comments on commit cd75794

Please sign in to comment.