Skip to content
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

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

Open
1 task done
rm-info opened this issue Apr 29, 2024 · 6 comments
Open
1 task done
Assignees
Labels

Comments

@rm-info
Copy link

rm-info commented Apr 29, 2024

Check if your issue exists

  • 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

@nenes25
Copy link
Owner

nenes25 commented Apr 29, 2024

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,

@rm-info
Copy link
Author

rm-info commented Apr 29, 2024

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

`

@nenes25
Copy link
Owner

nenes25 commented Apr 30, 2024

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 added a commit that referenced this issue Apr 30, 2024
@rm-info
Copy link
Author

rm-info commented Apr 30, 2024

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

@mrm-aude
Copy link

It works for me too. Thank you !

@eve20100
Copy link

eve20100 commented Jan 6, 2025

Thanks so much for your work.
I'm on a 1.7.3.2 with PHP 7.0

I had the same problem with the captcha verification, didn't work.
After deleting :void in debugger.php, it was OK and now it works.

Thank you !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants