2
0
forked from Wavyzz/dolibarr

Better log

This commit is contained in:
ldestailleur
2025-03-12 15:55:11 +01:00
parent 2538baa4dc
commit acf84cec9b

View File

@@ -803,10 +803,7 @@ class Export
$remaintopay = $tmpobjforcomputecall->getRemainToPay();
}
$obj->$alias = $remaintopay;
} elseif (is_array($item) &&
array_key_exists('rule', $item) &&
$item['rule'] == 'compute'
) {
} elseif (is_array($item) && array_key_exists('rule', $item) && $item['rule'] == 'compute') {
// Custom compute
$alias = str_replace(array('.', '-', '(', ')'), '_', $key);
$value = '';
@@ -853,11 +850,11 @@ class Export
// TODO FIXME
// Export of compute field does not work. $obj contains $obj->alias_field and formula may contains $obj->field
// Also the formula may contains objects of class that are not loaded.
$computestring = is_string($item) ? $item : json_encode($item);
//$computestring = is_string($item) ? $item : json_encode($item);
//$tmp = (string) dol_eval($computestring, 1, 0, '2');
//$obj->$alias = $tmp;
$this->error = "ERROPNOTSUPPORTED. Operation ".$computestring." not supported. Export of 'computed' extrafields is not yet supported, please remove field.";
$this->error = "ERRORNOTSUPPORTED. Operation not supported. Export of ".var_export($key, true).' '.var_export($item, true)." extrafields is not yet supported, please remove field.";
return -1;
}
}