Error: Method “getStorage” does not exist and was not trapped in __call()

Error: Method “getStorage” does not exist and was not trapped in __call()

This turned out to be a missed call to Zend_Auth::getInstance() before calling hasIdentity()

SOLUTION

$auth = Zend_Auth::getInstance();
if($auth->hasIdentity())
{
$user_id = $auth->getIdentity()->id;
}

STACK

#0 [internal function]: Zend_Controller_Action->__call('getStorage', Array)
#1 D:\...\Zend\Auth.php(133): SomeController->getStorage()
#2 D:\...\application\controllers\SomeController.php(56): Zend_Auth->hasIdentity()
#3 D:\...\library\Zend\Controller\Action.php(503): SomeController->anAction()
#4 D:\...\library\Zend\Controller\Dispatcher\Standard.php(285): Zend_Controller_Action->dispatch('anAction')
#5 D:\...\library\Zend\Controller\Front.php(934): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#6 D:\...\application\bootstrap.php(65): Zend_Controller_Front->dispatch()
#7 D:\...\index.php(11): Bootstrap->runApp()
#8 {main}
Advertisements

2 thoughts on “Error: Method “getStorage” does not exist and was not trapped in __call()

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s