Post by mRC » Tue Sep 06, 2016 2:37 pm

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.

mRC
Active Member

Posts

Joined
Wed Nov 12, 2014 12:43 am

Post by mRC » Fri Sep 09, 2016 4:42 pm

any help on this issue please

mRC
Active Member

Posts

Joined
Wed Nov 12, 2014 12:43 am

Post by mRC » Tue Sep 20, 2016 3:00 pm

Anyone else having this issue??

mRC
Active Member

Posts

Joined
Wed Nov 12, 2014 12:43 am

Post by OSWorX » Tue Sep 20, 2016 8:06 pm

No, but it would be good to know what you are using?

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

Image


User avatar
Expert Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by mRC » Tue Sep 20, 2016 8:22 pm

Hi

We are using Linux and PHP 5.6.16.

Thanks

mRC
Active Member

Posts

Joined
Wed Nov 12, 2014 12:43 am

Post by pm-netti » Wed Sep 21, 2016 4:18 am

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

Image
- - - OpenCart Upgrade Service - - -


User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä-Finland

Post by mRC » Wed Sep 21, 2016 2:35 pm

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">

mRC
Active Member

Posts

Joined
Wed Nov 12, 2014 12:43 am

Post by pm-netti » Wed Sep 21, 2016 7:49 pm

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>

Image
- - - OpenCart Upgrade Service - - -


User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä-Finland

Post by mRC » Wed Sep 21, 2016 8:09 pm

Hello

So what does this mean

mRC
Active Member

Posts

Joined
Wed Nov 12, 2014 12:43 am

Post by pm-netti » Wed Sep 21, 2016 11:59 pm

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.

Image
- - - OpenCart Upgrade Service - - -


User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä-Finland

Post by mRC » Thu Sep 22, 2016 2:28 am

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.

mRC
Active Member

Posts

Joined
Wed Nov 12, 2014 12:43 am

Post by pm-netti » Thu Sep 22, 2016 4:37 am

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);
}

Image
- - - OpenCart Upgrade Service - - -


User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä-Finland

Post by parkookk » Thu Sep 29, 2016 9:22 pm

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

http://mediasos.co.uk/ - http://avtransfer.co.uk/


New member

Posts

Joined
Thu Jan 17, 2013 11:56 pm
Location - london

Post by mRC » Thu Sep 29, 2016 10:24 pm

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.

mRC
Active Member

Posts

Joined
Wed Nov 12, 2014 12:43 am

Post by marlin.nl » Sat May 13, 2017 2:36 pm

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:
$this->session->data['gcapcha']

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

Because i dont know if this is the fix i will have to wait ;)

Live store Opencart 2.3.0.2 modified on https://webshopmarlin.nl


New member

Posts

Joined
Thu Aug 25, 2011 11:22 pm

Post by mRC » Fri Jul 14, 2017 4:52 am

Did you ever find if this fix worked

mRC
Active Member

Posts

Joined
Wed Nov 12, 2014 12:43 am

Post by upacreek » Thu Sep 07, 2017 6:13 am

I'm writing this up so others searching for this answer can give this a try.

I was seeing the same "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.

Newbie

Posts

Joined
Wed Aug 10, 2011 3:53 am
Who is online

Users browsing this forum: gunner86 and 10 guests