ProxiBlue / reCaptcha

Clean implementation of Google reCaptcha for magento
http://www.proxiblue.com.au/blog/magento-recaptcha/
GNU General Public License v3.0
86 stars 61 forks source link

ContactUs Session-Data is not working in 1.9.3 #10

Closed doku-san closed 7 years ago

doku-san commented 7 years ago

Hi,

I tried you extension. It is working fine on all Pages. On the "Contacts"-Page I added the <?php echo $this->getChildHtml('recaptcha'); ?> and the Captcha is displayed and working correctly.

But the Patch for not loosing all data you provided for the form.phtml is not working for me in 1.9.3.4.

I get a fatal error for: $controller->getRequest()->getPost();

Maybe this patch won't work with 1.9.3 any more? Do you have any ideas? Or could you provide an example form.phtml?

Thanks, Yours Doku

ProxiBlue commented 7 years ago

I will give a test on a vanilla 1.9.3 install. Then get back to you

ProxiBlue commented 7 years ago

Hi,

tested on 1.9.3.2 - seems to work as expected. Busy bringing up 1.9.3.4, see in that version

selection_347 selection_348

ProxiBlue commented 7 years ago

Tested on 1.9.3.4, results the same as previous comments.

In the code ProxiBlue_ReCaptcha_Model_Observer:: checkContact

What is the result of $controller = $observer->getControllerAction(); Is that a class? if so, which class?

doku-san commented 7 years ago

Thanks for your help. That' wired. Maybe I'am missing something.

I edited form.phtml:

$formdata = new Varien_Object();
$formdata->setData(Mage::getSingleton('customer/session')->getFormData());

$_email = ($formData->getEmail()) ? $formData->getEmail() : $this->helper('contacts')->getEmail();
$_comment = ($formData->getComment()) ? $formData->getComment() : '';

Then I get following PHP-Error: Fatal error: Call to a member function getEmail() on null in /var/www/html/app/design/frontend/myTemplate/default/template/contacts/form.phtml on line 30

PS: I am still figuring out how to get the result of $controller...

doku-san commented 7 years ago

But it is working with:

$formdata = new Varien_Object();
$formdata->setData(Mage::getSingleton('customer/session')->getFormData());

$_e_mail = $formdata->getData('email');
$_comment = $formdata->getData('comment');
$_name = $formdata->getData('name');
$_telefon = $formdata->getData('telephone');
ProxiBlue commented 7 years ago

formdata should be formData (capital D)

$formdata is not the same as $formData