lib/api
Aleksander Machniak
machniak at kolabsys.com
Wed Sep 26 09:08:38 CEST 2012
lib/api/kolab_api_service_type.php | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
New commits:
commit b278f63feeac45e29cbb6de09f8f72751e3495a1
Author: Aleksander Machniak <alec at alec.pl>
Date: Wed Sep 26 09:08:17 2012 +0200
Fix error handling in type.edit
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;
}
More information about the commits
mailing list