diff --git a/api/src/Storage/Base.php b/api/src/Storage/Base.php index e929d262db..639e944a2a 100644 --- a/api/src/Storage/Base.php +++ b/api/src/Storage/Base.php @@ -776,15 +776,19 @@ class Base $data = $keys; $keys = array(); foreach($this->db_cols as $db_col => $col) { - if (is_int($db_col)) - { - $keys[] = $col; - } - elseif (isset($data[$col])) + if (isset($data[$col])) { $keys[$db_col] = $col; } } + // keep sql fragments (with integer key) + foreach($data as $key => $val) + { + if (is_int($key)) + { + $keys[] = $val; + } + } } $data = $this->data2db($data);