Merge pull request #2354 from marcoAntonioNina/BUG-14834

BUG-14834 Error when executing a case that has PM table Dynaform
This commit is contained in:
julceslauhub
2014-05-06 12:13:15 -03:00

View File

@@ -164,9 +164,20 @@ try {
// saving the data ina pm table in case that is a new record
if (! empty( $newValues )) {
$id = key( $newValues );
$newValues[$id] = $aData['APP_DATA'][$id];
$idPmtable = $oForm->fields[$id]->pmconnection->pmtable != '' ? $oForm->fields[$id]->pmconnection->pmtable : $oForm->fields[$id]->owner->tree->children[0]->attributes['pmtable'];
$newValues[$id] = $aData['APP_DATA'][$id];
foreach ($aKeys as $key => $value) {
if (!isset($newValues[$key]) || $newValues[$key] == '') {
$G_PUBLISH = new Publisher();
$aMessage = array ();
$aMessage['MESSAGE'] = G::LoadTranslation('ID_FILL_PRIMARY_KEYS') . ' ('. $key . ') ';
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', 'blank' );
die();
}
}
$idPmtable = $oForm->fields[$id]->pmconnection->pmtable != '' ? $oForm->fields[$id]->pmconnection->pmtable : $oForm->fields[$id]->owner->tree->children[0]->attributes['pmtable'];
if (!($oAdditionalTables->updateDataInTable($idPmtable, $newValues ))) {
//<--This is to know if it is a new registry on the PM Table