Commit aee2da20 authored by ispcomm's avatar ispcomm
Browse files

till proposed update for _primary_id enforcement (w.i.p.)

parent afc482bc
......@@ -199,7 +199,9 @@ class remoting_lib extends tform_base {
function getSQL($record, $action = 'INSERT', $primary_id = 0, $sql_ext_where = '', $dummy = '') {
global $app;
$this->primary_id_override = true;
if(!is_array($this->formDef)) $app->error("Form definition not found.");
$this->dataRecord = $record;
......
......@@ -104,6 +104,7 @@ class tform_base {
var $module;
var $primary_id;
var $diffrec = array();
var $primary_id_override = false;
/**
* Loading of the table definition
......@@ -1271,6 +1272,11 @@ class tform_base {
if($api == true) $fields = &$this->formDef['fields'];
else $fields = &$this->formDef['tabs'][$tab]['fields'];
if($this->primary_id_override && isset($record['_primary_id'])) {
$sql_insert_key .= '`'.$this->formDef["db_table_idx"].'`, ';
$sql_insert_val .= intval($record['_primary_id']).", ";
}
// go trough all fields of the tab
if(is_array($record)) {
foreach($fields as $key => $field) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment