Target object does not need to have all source object extrafields
This commit is contained in:
parent
83b297a9b2
commit
e1cf107096
@ -3921,7 +3921,15 @@ abstract class CommonObject
|
|||||||
$langs->load('admin');
|
$langs->load('admin');
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
$extrafields = new ExtraFields($this->db);
|
$extrafields = new ExtraFields($this->db);
|
||||||
$extrafields->fetch_name_optionals_label($this->table_element);
|
$target_extrafields=$extrafields->fetch_name_optionals_label($this->table_element);
|
||||||
|
|
||||||
|
//Eliminate copied source object extra_fiels that do not exist in target object
|
||||||
|
$new_array_options=array();
|
||||||
|
foreach ($this->array_options as $key => $value) {
|
||||||
|
if (in_array(substr($key,8), array_keys($target_extrafields)))
|
||||||
|
$new_array_options[$key] = $value;
|
||||||
|
}
|
||||||
|
$this->array_options =$new_array_options;
|
||||||
|
|
||||||
foreach($this->array_options as $key => $value)
|
foreach($this->array_options as $key => $value)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user