ZF-7594: Fatal error: Call to a member function getHeader()
Description
Using the Zend_Rest_Route throws fatal error PHP Fatal error: Call to a member function getHeader() on a non-object in ...\Zend\Rest\Route.php on line 165
i commented this part out to get the rest working
/* UOPS ERROR
} elseif ( $this->_request->getHeader('X-HTTP-Method-Override') ) {
$values[$this->_actionKey] = strtolower($this->_request->getHeader('X-HTTP-Method-Override'));
*/
The problem remains under php 5.2.10 under Windows XP Apache 2.2 as module.
(Info: inside creating issues the component selector does not show all components, so i decided to chose unknown)
Comments
Posted by Satoru Yoshida (satoruyoshida) on 2009-08-21T19:08:16.000+0000
Set component and change assinee
Posted by Luke Crouch (lcrouch) on 2009-08-25T13:53:15.000+0000
Can you show me the setup code you used to construct the Route object? I need a way to duplicate the issue with a test so I can fix it reliably.
Thanks, -L
Posted by Holger Schäfer (hschaefer123) on 2009-08-26T00:23:32.000+0000
I'm using the Zend_Application with my own run method inside the Bootstrap adding the Zend_Rest_Route for my test controller 'member' inside the default module:
public function run() { $front = $this->getResource('FrontController'); $default = $front->getDefaultModule(); if (null === $front->getControllerDirectory($default)) { throw new Zend_Application_Bootstrap_Exception( 'No default controller directory registered with front controller' ); }
Posted by Holger Schäfer (hschaefer123) on 2009-08-26T00:25:38.000+0000
This is the $request object from inside Zend_Rest_Route->match($request)
Posted by Matthew Weier O'Phinney (matthew) on 2009-08-27T12:22:01.000+0000
Fixed in trunk and 1.9 release branch.
Posted by Luke Crouch (lcrouch) on 2009-08-27T14:23:15.000+0000
Thanks MWO. Did we need a test case for it? I had the same fix ready to go but had trouble reproducing in a test case. :(