Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix for return id for insert_record - needs to be cast to an int

  • Loading branch information...
commit b0debb89ce8990d993d42f64eabf66b2dbf1766e 1 parent 2e9ddb9
mjollnir_ authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/datalib.php
View
2  lib/datalib.php
@@ -915,7 +915,7 @@ function insert_record($table, $dataobject, $returnid=true, $primarykey='id') {
if ( !isset($dataobject->{$primarykey})
&& $CFG->dbtype === 'postgres7'
&& $returnid == true ) {
- if ($nextval = get_field_sql("SELECT NEXTVAL('{$CFG->prefix}{$table}_{$primarykey}_seq')")) {
+ if ($nextval = (int)get_field_sql("SELECT NEXTVAL('{$CFG->prefix}{$table}_{$primarykey}_seq')")) {
$dataobject->{$primarykey} = $nextval;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.