...and?
Printable View
...and?
ZC v2.1.0, PHP 8.2, OPC 2.5.4
Using the latest (as of today) reCAPTCHA version from github.
Attempting to add reCAPTCHA to OPC's create_account_register page. Although create_account_register 'uses' includes/modules/pages/create_account it has its own header.php file of header_php_create_account_register.php and as such the reCAPTCHA process gives a blank page when creating a registered account, as can be seen from the logs below.
I am comfortable adding new instances of say CREATE_ACCOUNT_REGISTER, if necessary, but what code would I need for the mod to recognise header_php_create_account_register.php?
Code:[25-Feb-2025 10:09:51 Europe/London] Request URI: /create-account, IP address: 127.0.0.1, Language id 1
#0 D:\wamp64\www\MY_DOMAIN.co.uk\includes\classes\observers\auto.google_recaptcha_observer.php(52): zen_debug_error_handler()
#1 D:\wamp64\www\MY_DOMAIN.co.uk\includes\classes\observers\auto.google_recaptcha_observer.php(52): require()
#2 D:\wamp64\www\MY_DOMAIN.co.uk\includes\classes\traits\NotifierManager.php(106): zcObserverGoogleRecaptchaObserver->update()
#3 D:\wamp64\www\MY_DOMAIN.co.uk\includes\modules\pages\create_account\header_php_create_account_register.php(38): base->notify()
#4 D:\wamp64\www\MY_DOMAIN.co.uk\index.php(35): require('D:\\wamp64\\www\\k...')
--> PHP Warning: require(D:/wamp64/www/MY_DOMAIN.co.uk/includes/classes/vendors/Google/recaptcha/src/autoload.php): Failed to open stream: No such file or directory in D:\wamp64\www\MY_DOMAIN.co.uk\includes\classes\observers\auto.google_recaptcha_observer.php on line 52.
[25-Feb-2025 10:09:51 Europe/London] PHP Fatal error: Uncaught Error: Failed opening required 'D:/wamp64/www/MY_DOMAIN.co.uk/includes/classes/vendors/Google/recaptcha/src/autoload.php' (include_path='.;C:\php\pear') in D:\wamp64\www\MY_DOMAIN.co.uk\includes\classes\observers\auto.google_recaptcha_observer.php:52
Stack trace:
#0 D:\wamp64\www\MY_DOMAIN.co.uk\includes\classes\traits\NotifierManager.php(106): zcObserverGoogleRecaptchaObserver->update(Object(notifier), 'NOTIFY_CREATE_A...', Array, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
#1 D:\wamp64\www\MY_DOMAIN.co.uk\includes\modules\pages\create_account\header_php_create_account_register.php(38): base->notify('NOTIFY_CREATE_A...')
#2 D:\wamp64\www\MY_DOMAIN.co.uk\index.php(35): require('D:\\wamp64\\www\\k...')
#3 {main}
thrown in D:\wamp64\www\MY_DOMAIN.co.uk\includes\classes\observers\auto.google_recaptcha_observer.php on line 52
[25-Feb-2025 10:09:51 Europe/London] Request URI: /create-account, IP address: 127.0.0.1
--> PHP Fatal error: Uncaught Error: Failed opening required 'D:/wamp64/www/MY_DOMAIN.co.uk/includes/classes/vendors/Google/recaptcha/src/autoload.php' (include_path='.;C:\php\pear') in D:\wamp64\www\MY_DOMAIN.co.uk\includes\classes\observers\auto.google_recaptcha_observer.php:52
Stack trace:
#0 D:\wamp64\www\MY_DOMAIN.co.uk\includes\classes\traits\NotifierManager.php(106): zcObserverGoogleRecaptchaObserver->update(Object(notifier), 'NOTIFY_CREATE_A...', Array, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
#1 D:\wamp64\www\MY_DOMAIN.co.uk\includes\modules\pages\create_account\header_php_create_account_register.php(38): base->notify('NOTIFY_CREATE_A...')
#2 D:\wamp64\www\MY_DOMAIN.co.uk\index.php(35): require('D:\\wamp64\\www\\k...')
#3 {main}
thrown in D:\wamp64\www\MY_DOMAIN.co.uk\includes\classes\observers\auto.google_recaptcha_observer.php on line 52.
[25-Feb-2025 10:09:51 Europe/London] Request URI: /create-account, IP address: 127.0.0.1
--> PHP Fatal error: Uncaught Error: Failed opening required 'D:/wamp64/www/MY_DOMAIN.co.uk/includes/classes/vendors/Google/recaptcha/src/autoload.php' (include_path='.;C:\php\pear') in D:\wamp64\www\MY_DOMAIN.co.uk\includes\classes\observers\auto.google_recaptcha_observer.php:52
Stack trace:
#0 D:\wamp64\www\MY_DOMAIN.co.uk\includes\classes\traits\NotifierManager.php(106): zcObserverGoogleRecaptchaObserver->update(Object(notifier), 'NOTIFY_CREATE_A...', Array, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
#1 D:\wamp64\www\MY_DOMAIN.co.uk\includes\modules\pages\create_account\header_php_create_account_register.php(38): base->notify('NOTIFY_CREATE_A...')
#2 D:\wamp64\www\MY_DOMAIN.co.uk\index.php(35): require('D:\\wamp64\\www\\k...')
#3 {main}
thrown in D:\wamp64\www\MY_DOMAIN.co.uk\includes\classes\observers\auto.google_recaptcha_observer.php on line 52.
Hi Simon,
I think you may be right - I downloaded v3.8 from Torvista's github repository also, and see that the vendors/Google/recaptcha directory is actually empty. Not sure what the reason for this is, but I followed the README.md instructions to obtain the files from Google's github, and applied the mentioned correction.
Quote:
`/includes/classes/vendors/Google/recaptcha`
In here are the set of files from the Google reCAPTCHA library on GitHub: https://github.com/google/recaptcha
The current version included here is tag v1.3.0 (newer versions may be available).
All files are unmodified, bar one: ReCaptcha.php, which has minor fixes for php 8.4
https://github.com/torvista/Zen_Cart...PTCHA/issues/3
To be clear, the entire contents of https://github.com/google/recaptcha/tree/master/src (file autoload.php and directory ReCaptcha) needs to be placed inCode:includes/classes/vendors/Google/recaptcha/
Quote:
vendors/Google/recaptcha directory is actually empty. Not sure what the reason for this is
Me neither, Gitkraken would not "see" it to upload it. I could not include it as a submodule as it needs a fix for php8.4.
I've now included it as a differently-named folder, and updated the readme.