Index: branches/5.0.x/core/kernel/db/dbitem.php =================================================================== diff -u -N -r12368 -r12706 --- branches/5.0.x/core/kernel/db/dbitem.php (.../dbitem.php) (revision 12368) +++ branches/5.0.x/core/kernel/db/dbitem.php (.../dbitem.php) (revision 12706) @@ -1,6 +1,6 @@ IDField => $this->ID); + if (!isset($keys_hash)) { + $keys_hash = Array ($this->IDField => $this->ID); + } $ret = ''; - foreach($keys_hash as $field => $value) - { + + foreach ($keys_hash as $field => $value) { if (!preg_match('/\./', $field)) { - $ret .= '(`'.$this->TableName.'`.'.$field.' = '.$this->Conn->qstr($value).') AND '; + $ret .= '(`' . $this->TableName . '`.' . $field . ' = ' . $this->Conn->qstr($value) . ') AND '; } else { - $ret .= '('.$field.' = '.$this->Conn->qstr($value).') AND '; + $ret .= '(' . $field . ' = ' . $this->Conn->qstr($value) . ') AND '; } } - return preg_replace('/(.*) AND $/', '\\1', $ret); + return substr($ret, 0, -5); } /**