From 1b5e992f439524e93532094eaa8c46dae47e05a1 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 6 Nov 2017 16:43:23 +0100 Subject: [PATCH] allow sql fragments in Api\Storage\Base::delete as in other places --- api/src/Storage/Base.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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);