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

Description

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:


if ($this->isDefaultTableAdapter()) {
    Zend_Db_Table::setDefaultAdapter($adapter);
}

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

Possible work around (application/Bootstrap.php):


public function _initDb ()
{         
    $aConfig = $this->getOptions();
       
    $oAdapter = Zend_Db::factory($aConfig['resources']['db']['adapter'], $aConfig['resources']['db']['params']);
        
    Zend_Db_Table::setDefaultAdapter($oAdapter);        
}

Comments

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.

Fixed in 1.12 branch and trunk.

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

Updated, works indeed. Thanks!