ZF-2217: Zend_Db_Table_Abstract doesn't return the right primary key when inserting a new row

Description

Zend_Db_Table_Abstract::insert() - line 786 returns the wrong primary key (returns false) because array index wasn't resetted.

 
       $pkData = array_intersect_key($data, array_flip($primary));
       if (count($primary) == 1) {
            return current($pkData);
        } else {
            return $pkData;
        }

edit to:

 
        $pkData = array_intersect_key($data, array_flip($primary));
        if (count($primary) == 1) {
            reset($pkData);
            return current($pkData);
        } else {
            return $pkData;
        }

Comments

the fixed version

Resolved for next minor release with SVN r7937.

Resolved for next mini-release with SVN r7938.