summaryrefslogtreecommitdiffstats
path: root/lib/api/kolab_api_service_type.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-09-26 09:08:17 +0200
committerAleksander Machniak <alec@alec.pl>2012-09-26 09:08:17 +0200
commitb278f63feeac45e29cbb6de09f8f72751e3495a1 (patch)
tree68134e941f7220e918c9030a240cee886a6fb879 /lib/api/kolab_api_service_type.php
parent6e50c6786ed16bdeaa9b2a6ff51f42c63978d278 (diff)
downloadwebadmin-b278f63feeac45e29cbb6de09f8f72751e3495a1.tar.gz
Fix error handling in type.edit
Diffstat (limited to 'lib/api/kolab_api_service_type.php')
-rw-r--r--lib/api/kolab_api_service_type.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/api/kolab_api_service_type.php b/lib/api/kolab_api_service_type.php
index 429df7b..11d9387 100644
--- a/lib/api/kolab_api_service_type.php
+++ b/lib/api/kolab_api_service_type.php
@@ -178,18 +178,16 @@ class kolab_api_service_type extends kolab_api_service
$query[$idx] = $idx . " = " . $this->db->escape($value);
}
- $this->db->query("UPDATE {$type}_types SET "
+ $result = $this->db->query("UPDATE {$type}_types SET "
. implode(', ', $query) . " WHERE id = ?", array($postdata['id']));
- if (!($id = $this->db->last_insert_id())) {
+ if (!$result) {
return false;
}
// update cache
$this->cache['object_types'][$type][$id] = $postdata;
- $postdata['id'] = $id;
-
return $postdata;
}