From bdbdce92ab2f32767d4d742bfa6494c235897e05 Mon Sep 17 00:00:00 2001 From: xzilla Date: Sat, 3 Mar 2007 14:25:14 +0000 Subject: [PATCH] Fix problem where failed update would report as duplicate update error and fail to return edit screen. Based on report/patch from ioguix --- classes/database/Postgres.php | 7 +++++-- display.php | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/classes/database/Postgres.php b/classes/database/Postgres.php index c49427d1..21299e92 100755 --- a/classes/database/Postgres.php +++ b/classes/database/Postgres.php @@ -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; } diff --git a/display.php b/display.php index 38607fc1..3a0341cd 100644 --- a/display.php +++ b/display.php @@ -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) @@ -31,7 +31,10 @@ 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']); -- 2.39.5