Update extrafields.class.php

This commit is contained in:
Laurent Destailleur 2023-05-22 18:42:14 +02:00 committed by GitHub
parent 6cacc44051
commit 6469d85c4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1991,8 +1991,6 @@ class ExtraFields
continue;
}
$langs->load($this->attributes[$object->table_element]['langfile'][$key]);
if ($this->attributes[$object->table_element]['required'][$key]) { // Value is required
// Check if functionally empty without using GETPOST (depending on the type of extrafield, a
// technically non-empty value may be treated as empty functionally).
@ -2002,6 +2000,9 @@ class ExtraFields
|| (!is_array($_POST["options_".$key]) && isset($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] == 'sellist' && $_POST['options_'.$key] == '0')
|| (is_array($_POST["options_".$key]) && empty($_POST["options_".$key]))) {
//print 'ccc'.$value.'-'.$this->attributes[$object->table_element]['required'][$key];
if (!empty($this->attributes[$object->table_element]['langfile'][$key])) {
$langs->load($this->attributes[$object->table_element]['langfile'][$key]);
}
$nofillrequired++;
$error_field_required[] = $langs->transnoentitiesnoconv($value);
}