ZF-12466: Db Resource default adapter is set to String

Issue Type: Bug Created: 2012-11-14T10:05:00.000+0000 Last Updated: 2012-12-18T20:08:28.000+0000 Status: Resolved Fix version(s): - 1.12.1 (18/Dec/12)

Reporter: Milan Verbaandert (milananas) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Application_Resource

Related issues: - ZF-9615



In revision 25118 the file Zend_Application_Resource_Db is changed. With this change the Zend_Db_Table default adapter is set to a string instead of a Zend_Db_Adapter_Abstract instance.

These lines:

<pre class="highlight">
if ($this->isDefaultTableAdapter()) {

Are removed from 'init()' and placed into 'getDbAdapter()', and uses $adapter which is a string in this case.

Possible work around (application/Bootstrap.php):

<pre class="highlight">
public function _initDb ()
    $aConfig = $this->getOptions();
    $oAdapter = Zend_Db::factory($aConfig['resources']['db']['adapter'], $aConfig['resources']['db']['params']);


Posted by Arnold Pistorius (arnoldpistorius) on 2012-11-14T17:29:03.000+0000

This is also happening to my systems. I have a database resource which automatically was instantiated by Zend_Application, but since the last version of the file Zend_Application_Resource_Db there are only 500 internal server errors. I used the fix Milan provided above and this work arounds the problem (definately not fixing it!!).

Please revert the changes as quick as possible, this is main functionallity of the Zend_Application component.

Posted by Matthew Weier O'Phinney (matthew) on 2012-11-14T18:28:29.000+0000

Fixed in 1.12 branch and trunk.

The change was not completely reverted -- it was just reworked so that it operates correctly.

Posted by Milan Verbaandert (milananas) on 2012-11-15T07:50:35.000+0000

Updated, works indeed. Thanks!

Have you found an issue?

See the Overview section for more details.


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

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