]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #3238 fix for updating name of metadata for trunk
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 26 Mar 2011 18:46:16 +0000 (18:46 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 26 Mar 2011 18:46:16 +0000 (18:46 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8850 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/metadata.php

index f1bd69895700121bb0dc5f7d58ea3b1e7063aaca..a6b1bb43a85394707df89ffdda54edc5a452d6b6 100644 (file)
@@ -146,7 +146,7 @@ function create_metadata($entity_guid, $name, $value, $value_type = '', $owner_g
 /**
  * Update a specific piece of metadata.
  *
- * @param int    $id         Metadata id
+ * @param int    $id         ID of the metadata to update
  * @param string $name       Metadata name
  * @param string $value      Metadata value
  * @param string $value_type Value type
@@ -210,8 +210,8 @@ function update_metadata($id, $name, $value, $value_type, $owner_guid, $access_i
 
        // If ok then add it
        $query = "UPDATE {$CONFIG->dbprefix}metadata"
-               . " set value_id='$value', value_type='$value_type', access_id=$access_id,"
-               . " owner_guid=$owner_guid where id=$id and name_id='$name'";
+               . " set name_id='$name', value_id='$value', value_type='$value_type', access_id=$access_id,"
+               . " owner_guid=$owner_guid where id=$id";
 
        $result = update_data($query);
        if ($result !== false) {