-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
E_ERROR: Call to a member function hasLastUrl() on null #36
Comments
Same issue here with respect to review pages. Looks like using the defined getter Just in case it's helpful, here's the stack trace:
Also happy to submit a PR if requested. |
…ed some whitespace.
Got the same error. Created a pull request to fix the issue. |
(Temporary) Solution: Add the following query parameter to the request url: Mage_Core_Controller_Front_Action::PARAM_NAME_BASE64_URL => Mage::helper('core/url')->getCurrentBase64Url() This will be caught in Studioforty9_Recaptcha_Helper_Redirect::_getRefererUrl /**
* Identify referer url via all accepted methods:
* - HTTP_REFERER
* - Regular
* - base64-encoded request param
*
* @return string
*/
protected function _getRefererUrl()
{
$request = Mage::app()->getRequest();
$refererUrl = $request->getServer('HTTP_REFERER');
if ($url = $request->getParam(Mage_Core_Controller_Front_Action::PARAM_NAME_REFERER_URL)) {
$refererUrl = $url;
}
if ($url = $request->getParam(Mage_Core_Controller_Front_Action::PARAM_NAME_BASE64_URL)) {
$refererUrl = Mage::helper('core')->urlDecode($url);
}
if ($url = $request->getParam(Mage_Core_Controller_Front_Action::PARAM_NAME_URL_ENCODED)) {
$refererUrl = Mage::helper('core')->urlDecode($url);
}
return $refererUrl;
} |
Fixes studioforty9-dev#36. Replaced _session with getSession(), removed some whitespace.
Hi,
Recently we've been getting the above error using vsn 1.5.0 of Recaptcha. Error is coming from line 67 of Helper/Redirect.php, and looks as though it's not checking that $this->_session actually exists before accessing its hasLastUrl() method. I checked in latest 1.5.7 code and doesn't look as though any recent changes in this area.
I'd be happy to submit a code change to address this, but not sure how to create a unit test for it.
Andy Ingham
The text was updated successfully, but these errors were encountered: