Page 1 of 1

g-recaptcha-response issue V2.3.0.2

Posted: Tue Sep 06, 2016 2:37 pm
by mRC
Hello

We have upgraded to the latest version 2.3.0.2 without any problems but we seem to be having the following errors in the admin section. We are running journal too but other than that fresh install.

Code: Select all

2016-09-04 8:07:21 - PHP Warning:  filesize(): stat failed for /var/www/vhosts/xxxxx/httpdocs/system/storage/cache/cache.currency.1472975880 in /var/www/vhosts/xxxxx/httpdocs/system/library/cache/file.php on line 32
2016-09-04 8:07:21 - PHP Warning:  fread(): Length parameter must be greater than 0 in /var/www/vhosts/xxxxx/httpdocs/system/library/cache/file.php on line 32
2016-09-06 1:00:39 - PHP Notice:  Undefined index: enquiry in /var/www/vhosts/xxxxx/httpdocs/catalog/controller/information/contact.php on line 170
2016-09-06 1:00:39 - PHP Notice:  Undefined index: g-recaptcha-response in /var/www/vhosts/xxxxx/httpdocs/catalog/controller/extension/captcha/google_captcha.php on line 27

any help please, everything seems to be working on the shop front as well.

Re: g-recaptcha-response issue V2.3.0.2

Posted: Fri Sep 09, 2016 4:42 pm
by mRC
any help on this issue please

Re: g-recaptcha-response issue V2.3.0.2

Posted: Tue Sep 20, 2016 3:00 pm
by mRC
Anyone else having this issue??

Re: g-recaptcha-response issue V2.3.0.2

Posted: Tue Sep 20, 2016 8:06 pm
by OSWorX
No, but it would be good to know what you are using?

1. Server (*nix or Win*)
2. php-version

Re: g-recaptcha-response issue V2.3.0.2

Posted: Tue Sep 20, 2016 8:22 pm
by mRC
Hi

We are using Linux and PHP 5.6.16.

Thanks

Re: g-recaptcha-response issue V2.3.0.2

Posted: Wed Sep 21, 2016 4:18 am
by pm-netti
mRC wrote:Hello

We have upgraded to the latest version 2.3.0.2 without any problems but we seem to be having the following errors in the admin section. We are running journal too but other than that fresh install.

Code: Select all

2016-09-04 8:07:21 - PHP Warning:  filesize(): stat failed for /var/www/vhosts/xxxxx/httpdocs/system/storage/cache/cache.currency.1472975880 in /var/www/vhosts/xxxxx/httpdocs/system/library/cache/file.php on line 32
2016-09-04 8:07:21 - PHP Warning:  fread(): Length parameter must be greater than 0 in /var/www/vhosts/xxxxx/httpdocs/system/library/cache/file.php on line 32
2016-09-06 1:00:39 - PHP Notice:  Undefined index: enquiry in /var/www/vhosts/xxxxx/httpdocs/catalog/controller/information/contact.php on line 170
2016-09-06 1:00:39 - PHP Notice:  Undefined index: g-recaptcha-response in /var/www/vhosts/xxxxx/httpdocs/catalog/controller/extension/captcha/google_captcha.php on line 27

any help please, everything seems to be working on the shop front as well.
This issue was one site in May. I are forgotten it reason. But you can find issue to this way:
- Open page in Firefox browser
- Go to captcha form
- Select form in mouse ("paint")
- Press right button of mouse.
- Click option "View Selection Source".
- Check ( and copy) code

Re: g-recaptcha-response issue V2.3.0.2

Posted: Wed Sep 21, 2016 2:35 pm
by mRC
Hello

Thanks for your reply, I think the code below is what you was asking for

Code: Select all

<input type="text" name="email" value="" id="input-email" class="form-control"/></div></div><div class="form-group required">
<label class="col-sm-2 control-label" for="input-enquiry">Enquiry</label><div class="col-sm-10"><textarea name="enquiry" rows="10" id="input-enquiry" class="form-control"></textarea></div></div> <script data-rocketsrc="//www.google.com/recaptcha/api.js" type="text/rocketscript"></script> <fieldset><legend>Captcha</legend><div class="form-group required">
<label class="col-sm-2 control-label">Please complete the captcha validation below</label><div class="col-sm-10"><div class="g-recaptcha" data-sitekey="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-WzUg736"></div></div></div></fieldset></fieldset><div class="buttons"><div class="pull-right">

Re: g-recaptcha-response issue V2.3.0.2

Posted: Wed Sep 21, 2016 7:49 pm
by pm-netti
mRC wrote:Hello

Thanks for your reply, I think the code below is what you was asking for

Code: Select all

<input type="text" name="email" value="" id="input-email" class="form-control"/></div></div><div class="form-group required">
<label class="col-sm-2 control-label" for="input-enquiry">Enquiry</label><div class="col-sm-10"><textarea name="enquiry" rows="10" id="input-enquiry" class="form-control"></textarea></div></div> <script data-rocketsrc="//www.google.com/recaptcha/api.js" type="text/rocketscript"></script> <fieldset><legend>Captcha</legend><div class="form-group required">
<label class="col-sm-2 control-label">Please complete the captcha validation below</label><div class="col-sm-10"><div class="g-recaptcha" data-sitekey="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-WzUg736"></div></div></div></fieldset></fieldset><div class="buttons"><div class="pull-right">
My test display also this:

Code: Select all

<textarea id="g-recaptcha-response" name="g-recaptcha-response" class="g-recaptcha-response" style="width: 250px; height: 40px; border: 1px solid #c1c1c1; margin: 10px 25px; padding: 0px; resize: none;  display: none; "></textarea>

Re: g-recaptcha-response issue V2.3.0.2

Posted: Wed Sep 21, 2016 8:09 pm
by mRC
Hello

So what does this mean

Re: g-recaptcha-response issue V2.3.0.2

Posted: Wed Sep 21, 2016 11:59 pm
by pm-netti
mRC wrote:Hello

So what does this mean
When you press reCaptcha, that code need display in source code. This is field name "g-recaptcha-response", Openacart request this field in file google_captcha.php line 27.

Re: g-recaptcha-response issue V2.3.0.2

Posted: Thu Sep 22, 2016 2:28 am
by mRC
ok and thanks for looking into this for us, so looks like we have an issue.

It seems to work fine for us on the store front and the recaptcha is working too.

So can you provide us with information on how to solve the issue that's if you don't mind.

Re: g-recaptcha-response issue V2.3.0.2

Posted: Thu Sep 22, 2016 4:37 am
by pm-netti
mRC wrote:ok and thanks for looking into this for us, so looks like we have an issue.

It seems to work fine for us on the store front and the recaptcha is working too.

So can you provide us with information on how to solve the issue that's if you don't mind.
I do not remember any, how I fixed it in May. Maybe it "start" too early validate method. This can try fixed this way:
File catalog/controller/extension/captcha/google_captcha.php

Code: Select all

$recaptcha = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=' . urlencode($this->config->get('google_captcha_secret')) . '&response=' . $this->request->post['g-recaptcha-response'] . '&remoteip=' . $this->request->server['REMOTE_ADDR']);
	
			$recaptcha = json_decode($recaptcha, true);
Change to:

Code: Select all

$recaptcha['success'] = '';
if(isset($this->request->post['g-recaptcha-response'])){
    $recaptcha = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=' . urlencode($this->config->get('google_captcha_secret')) . '&response=' . $this->request->post['g-recaptcha-response'] . '&remoteip=' . $this->request->server['REMOTE_ADDR']);
	
			$recaptcha = json_decode($recaptcha, true);
}

Re: g-recaptcha-response issue V2.3.0.2

Posted: Thu Sep 29, 2016 9:22 pm
by parkookk
Hi,
I have the same error and applied this code replacement. Does anyone know how I can check to see if it's working fine or creates an error? How can I trigger the area that gave this error and see if all is fine or not?
Thanks

Re: g-recaptcha-response issue V2.3.0.2

Posted: Thu Sep 29, 2016 10:24 pm
by mRC
Hello

I have not done the code change as of yet im still trying to find out what is causing it.

I think its down to the location or ip its being submitted from.

Re: g-recaptcha-response issue V2.3.0.2

Posted: Sat May 13, 2017 2:36 pm
by marlin.nl
We also have this error.
It only appears when a visitor from Russia comes along at this moment.
Also i saw in catalog/controller/extension/captcha/google_captha.php the following line:

Code: Select all

$this->session->data['gcapcha']
I have changed those to:

Code: Select all

$this->session->data['gcaptcha']
Because i dont know if this is the fix i will have to wait ;)

Re: g-recaptcha-response issue V2.3.0.2

Posted: Fri Jul 14, 2017 4:52 am
by mRC
Did you ever find if this fix worked

Re: g-recaptcha-response issue V2.3.0.2

Posted: Thu Sep 07, 2017 6:13 am
by upacreek
I'm writing this up so others searching for this answer can give this a try.

I was seeing the same

Code: Select all

PHP Notice:  Undefined index: g-recaptcha-response in XXX\catalog\controller\extension\captcha\google_captcha.php on line 27
error in my logs with version 2.3.0.2.

The Register Account page was NOT displaying Google reCAPTCHA image. This was the page throwing the errors once the user selected Continue. Reviews and Contact pages worked successfully.

I tried all the other suggestions in the forums. Nothing worked.

What finally worked for me was to edit /catalog/view/theme/default/template/account/register.tpl

I MOVED the following code from Line 508 to Line 485

Code: Select all

<?php echo $captcha; ?>
Maybe it's because I have Newsletter hidden via mods? Whatever the case, Account Register page is now displaying the image and there are no more errors.

Re: g-recaptcha-response issue V2.3.0.2

Posted: Sat Feb 24, 2018 1:42 am
by vitalyk
Hi
Did anyone have solved this? because I am still getting this error and have tried all above.

Re: g-recaptcha-response issue V2.3.0.2

Posted: Wed Feb 28, 2018 3:47 am
by Mirbrou
Bonjour,
English follows below
dans mon cas, captcha et recaptcha empêchait de transmettre les formulaires d'inscription et de contact.
J'ai corrigé le problème !
Cherchez dans les fichiers,
catalog/controller/account/register.php
catalog/controller/information/contact.php

les lignes suivantes:

Code: Select all

$data['captcha'] = $this->load->controller('extension/captcha/' . $this->config->get('config_captcha'), $this->error);
remplacez-les par

Code: Select all

$data['captcha'] = $this->load->controller('extension/captcha/' . $this->config->get('config_captcha'));
Tout semble être entré dans l'ordre !

in my case, captcha and recaptcha prevented from transmitting the forms for registration, contact.
Search in these files
catalog/controller/account/register.php
catalog/controller/information/contact.php

the following lines

Code: Select all

$data['captcha'] = $this->load->controller('extension/captcha/' . $this->config->get('config_captcha'), $this->error);
replace with

Code: Select all

$data['captcha'] = $this->load->controller('extension/captcha/' . $this->config->get('config_captcha'));
Everything seems to work now!

Re: g-recaptcha-response issue V2.3.0.2

Posted: Thu Mar 01, 2018 9:27 pm
by ADD Creative