BUG 7707 "Dynaform Date field in a RP table..." SOLVED

>>>Probably because ProcessMaker is trying to add a record to the RP Table with an empty date field set to "" instead of NULL.
- that was exactly the problem, but it is fixed now
This commit is contained in:
Erik Amaru Ortiz
2011-11-28 11:06:37 -04:00
parent 37b274a695
commit c12626c6b8

View File

@@ -624,9 +624,16 @@ class AdditionalTables extends BaseAdditionalTables {
switch ($row['ADD_TAB_TYPE']) { //switching by report table type
case 'NORMAL':
$caseData = array_change_key_case($caseData, CASE_UPPER);
// parsing empty values to null
foreach ($caseData as $i => $v) {
$caseData[$i] = $v === '' ? NULL : $v;
}
if (is_array($records) && count($records) > 0) { // if the record already exists on the report table
foreach ($records as $record) { //update all records
$record->fromArray(array_change_key_case($caseData, CASE_UPPER), BasePeer::TYPE_FIELDNAME);
$record->fromArray($caseData, BasePeer::TYPE_FIELDNAME);
if ($record->validate()) {
$record->save();
}