From 77e84a85f22ed5338a21ece0d2b7245a3c3a6a41 Mon Sep 17 00:00:00 2001
From: paca70 <paca70>
Date: Fri, 30 Jan 2004 07:45:36 +0000
Subject: [PATCH] My php 4.3.4/postgres7.4 combination was thinking that
 returned id-column was string and some modules were thingking that theres
 insert error if return value is string. Right now all id-colums is always
 integer so this should be ok.

---
 lib/datalib.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/datalib.php b/lib/datalib.php
index ac9d891dbd..3ed9d80c3a 100644
--- a/lib/datalib.php
+++ b/lib/datalib.php
@@ -775,7 +775,7 @@ function insert_record($table, $dataobject, $returnid=true) {
             if ($rs = $db->Execute("SELECT id FROM $CFG->prefix$table WHERE oid = $oid")) {
                 // every table needs to have a primary field named 'id' for this to work
                 if ($rs->RecordCount() == 1) {
-                    return $rs->fields[0];
+                    return (integer) $rs->fields[0]; // id field is integer, but this somehow needed??
                 }
             }
             return false;
-- 
2.39.5