Fix problem where failed update would report as duplicate update error and fail to...
authorxzilla <xzilla>
Sat, 3 Mar 2007 14:25:14 +0000 (14:25 +0000)
committerxzilla <xzilla>
Sat, 3 Mar 2007 14:25:14 +0000 (14:25 +0000)
classes/database/Postgres.php
display.php

index c49427d1c185e6277ed143b6cedd0c5ca13f4933..21299e92cf2d3a780f43eac5b71e3f71be71fda7 100755 (executable)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres.php,v 1.294 2007/01/21 22:59:25 xzilla Exp $
+ * $Id: Postgres.php,v 1.295 2007/03/03 14:25:14 xzilla Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -1722,7 +1722,10 @@ class Postgres extends ADODB_base {
                        }
 
                        $status = $this->execute($sql);
-                       if ($status != 0 || $this->conn->Affected_Rows() != 1) {
+                       if ($status != 0) { // update failed
+                               $this->rollbackTransaction();
+                               return -1;
+                       } elseif ($this->conn->Affected_Rows() != 1) { // more than one row could be updated
                                $this->rollbackTransaction();
                                return -2;
                        }
index 38607fc198cc947e26f3cb84652b071527c8f788..3a0341cda0ff3ac0812db3ee0e6bae60ecfec560 100644 (file)
@@ -9,7 +9,7 @@
         * @param $return_desc The return link name
         * @param $page The current page
         *
-        * $Id: display.php,v 1.57 2007/01/03 15:35:42 soranzo Exp $
+        * $Id: display.php,v 1.58 2007/03/03 14:25:14 xzilla Exp $
         */
 
        // Prevent timeouts on large exports (non-safe mode only)
                global $lang;
                global $PHP_SELF;
 
-               $key = $_REQUEST['key'];
+               if (is_array($_REQUEST['key']))
+           $key = $_REQUEST['key'];
+        else
+           $key = unserialize($_REQUEST['key']);
 
                if ($confirm) {
                        $misc->printTrail($_REQUEST['subject']);