Hi,
I just realised that the code in so_sql, in the save function, does not
behave as it should in the case where:
- the user is saving new data
- the table has an auto field
- the user has specified a value for the auto field
In this case, the code drills down to line 449 of file
etemplate/inc/class.so_sql.inc.php, which executes an update statement
instead of an insert statement. In this specific case, replacing the line
by:
$this->db->insert($this->table_name,$data,$keys,LINE,FILE);
fixes the issue as the insert method of egw_db already checks whether it
needs to do an update or an insert.
I request for the proposed patch to be inserted into egroupware. The code
can actually be simplified somehow there.
Regards
Raphaël
Raphael Alla
Mitija Australia
+61 4 15 678 576
+687 78 86 86
http://www.mitija.com