Fixing problem with set up of site course

This commit is contained in:
mjollnir_
2005-04-06 22:23:25 +00:00
parent cc02531610
commit 43dd005911
+2 -2
View File
@@ -912,7 +912,7 @@ function insert_record($table, $dataobject, $returnid=true, $primarykey='id') {
/// The efficient and transaction-safe strategy is to
/// move the sequence forward first, and make the insert
/// with an explicit id.
if ( !isset($dataobject->{$primarykey})
if ( empty($dataobject->{$primarykey})
&& $CFG->dbtype === 'postgres7'
&& $returnid == true ) {
if ($nextval = (int)get_field_sql("SELECT NEXTVAL('{$CFG->prefix}{$table}_{$primarykey}_seq')")) {
@@ -942,7 +942,7 @@ function insert_record($table, $dataobject, $returnid=true, $primarykey='id') {
/// if it's been passed explicitly,
/// or if we've retrieved it from a
/// sequence (Postgres).
if (isset($dataobject->{$primarykey})) {
if (!empty($dataobject->{$primarykey})) {
return $dataobject->{$primarykey};
}