Skip to content

Commit

Permalink
fix empty ID after insert, bcosca/fatfree#1175
Browse files Browse the repository at this point in the history
  • Loading branch information
ikkez committed May 7, 2020
1 parent 214cab5 commit e9f8572
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion db/sql/mapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,8 @@ function insert() {
if ($field['pkey']) {
$field['previous']=$field['value'];
if (!$inc && $field['pdo_type']==\PDO::PARAM_INT &&
is_null($field['value']) && !$field['nullable'])
empty($field['value']) && !$field['nullable'] &&
is_null($field['default']))
$inc=$key;
$filter.=($filter?' AND ':'').$this->db->quotekey($key).'=?';
$nkeys[$nctr+1]=[$field['value'],$field['pdo_type']];
Expand Down

0 comments on commit e9f8572

Please sign in to comment.