Issues

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

Issue Type: Bug Created: 2007-11-18T16:57:31.000+0000 Last Updated: 2008-02-26T12:56:03.000+0000 Status: Resolved Fix version(s): - 1.0.4 (26/Feb/08)

Reporter: Ulrich Berkmüller (thetiger2k) Assignee: Darby Felton (darby) Tags: - Zend_Db_Table

Related issues: Attachments: - Abstract.php

Description

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

<pre class="literal"> 
       $pkData = array_intersect_key($data, array_flip($primary));
       if (count($primary) == 1) {
            return current($pkData);
        } else {
            return $pkData;
        }

edit to:

<pre class="literal"> 
        $pkData = array_intersect_key($data, array_flip($primary));
        if (count($primary) == 1) {
            reset($pkData);
            return current($pkData);
        } else {
            return $pkData;
        }

Comments

Posted by Ulrich Berkmüller (thetiger2k) on 2007-11-18T17:03:20.000+0000

the fixed version

Posted by Darby Felton (darby) on 2008-02-11T18:48:56.000+0000

Resolved for next minor release with SVN r7937.

Posted by Darby Felton (darby) on 2008-02-11T19:00:56.000+0000

Resolved for next mini-release with SVN r7938.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts