eicaptcha icon indicating copy to clipboard operation
eicaptcha copied to clipboard

PS 1.7.1.2, PHP 7.0 install checking doesn't work. form validation doesn't work

Open rm-info opened this issue 9 months ago • 5 comments

Check if your issue exists

  • [X] I confirm that i've search that my issue does not already exists

Your prestashop version

1.7.2.x

Eicaptcha version

2.5.x

Do you use a specific theme ?

classic theme

Describe the bug

Hi all, I've been asked to install a captcha on a prestashop website (PS 1.7.1.2, PHP 7.0). Already did it successfully on a PS 1.7.8.6 smoothly, but right now nothing's working as expected.

  • Last release downloaded on Github
  • Fresh install of the module done 3 times
  • Cache cleaned
  • Tested with both V2 and V3
  • For now I'm not allowed to update PS and I cannot update PHP or I have other issues.

Is is supposed to work, or I have a version incompatibility? Any suggestion welcomed, thanks

Side question: where are saved the parameters of the modules? Because when I reinstall the module, the keys are already filled...

Screenshots

image ==> clicking on the link doesn't give any result

debug.log : Captcha soumis avec succès

image ==> index.php?controller=contact right after validating the email

image ==> Displayed in the console

Additional context

No response

rm-info avatar Apr 29 '24 14:04 rm-info

Hi,

If you enable the debug mode which error is displayed ? It may be related with your php version or with some other modules installed on your instance.

Regards,

nenes25 avatar Apr 29 '24 16:04 nenes25

Hi nenes25, thanks for your answer.

If it's about your module's debug mode, it was hidden in the middle of the screenshots of my first post:

debug.log : Captcha soumis avec succès

If you were asking about the Prestashop debug mode:

  • in the settings, clicking on the link to confirm the module installation, nothing special happens and I get only this in the console:
    image
  • when loading the contact page, the form displays, with the reCaptcha frame, with the checkbox to tick and the console gives me: image
  • when submitting the form, I know have a nice error:

` Whoops, looks like something went wrong. 1/1 FatalThrowableError in Debugger.php line 343: Type error: Return value of Eicaptcha\Module\Debugger::log() must be an instance of Eicaptcha\Module\void, none returned

in Debugger.php line 343
at Debugger->log('Captcha soumis avec succès') in eicaptcha.php line 471
at EiCaptcha->_validateCaptcha() in eicaptcha.php line 363
at EiCaptcha->hookActionContactFormSubmitBefore(array('cookie' => object(Cookie), 'cart' => object(Cart), 'altern' => '1')) in Hook.php line 895
at HookCore::coreCallHook(object(EiCaptcha), 'hookactionContactFormSubmitBefore', array('cookie' => object(Cookie), 'cart' => object(Cart), 'altern' => '1')) in Hook.php line 327
at HookCore::callHookOn(object(EiCaptcha), 'actionContactFormSubmitBefore', array('cookie' => object(Cookie), 'cart' => object(Cart), 'altern' => '1')) in Hook.php line 843
at HookCore::exec('actionContactFormSubmitBefore') in contactform.php line 6
at ContactformOverride->sendMessage() in contactform.php line 68
at Contactform->getWidgetVariables(null, array()) in contactform.php line 60
at Contactform->renderWidget(null, array()) in smartyfront.config.inc.php line 82
at {closure}(object(ContactformOverride), array()) in smartyfront.config.inc.php line 76
at withWidget(array(), object(Closure)) in smartyfront.config.inc.php line 83
at smartyWidget(array('name' => 'contactform'), object(Smarty_Dev_Template)) in SmartyLazyRegister.php line 83
at SmartyLazyRegister->__call('smartyWidget', array(array('name' => 'contactform'), object(Smarty_Dev_Template))) in smarty_internal_templatebase.php(157) : eval()'d code line 180
at content_663004f4dbe9b0_24115527(object(Smarty_Dev_Template)) in smarty_internal_templatebase.php line 188
at Smarty_Internal_TemplateBase->fetch('contact.tpl', null, 'layouts/layout-left-column.tpl', object(SmartyDev), false, true, false) in SmartyDev.php line 41
at SmartyDev->fetch('contact.tpl', null, 'layouts/layout-left-column.tpl') in FrontController.php line 660
at FrontControllerCore->smartyOutputContent('contact.tpl') in FrontController.php line 644
at FrontControllerCore->display() in ContactController.php line 29
at ContactController->initCursedPage() in Controller.php line 228
at ControllerCore->run() in Dispatcher.php line 369
at DispatcherCore->dispatch() in index.php line 28

`

rm-info avatar Apr 29 '24 20:04 rm-info

With the error message we can find that the issue is related with the old php version. Simply remove the "void" return type for the function public function log($message): void and it will works.

Regards,

nenes25 avatar Apr 30 '24 06:04 nenes25

Indeed after deleteting ": void" the form submission works. I still cannot check the installation in the administration panel, but it's not a big deal.

Thank you very much for your time and for your great work.

Regards

rm-info avatar Apr 30 '24 08:04 rm-info

It works for me too. Thank you !

mrm-aude avatar May 28 '24 09:05 mrm-aude