Post by N00bie » Sun Jan 31, 2016 7:13 am

Basic captcha works fine.
Google recaptcha does not work.

I can get Google recaptcha to work on a blank webpage so I know the codes and keys are all correct.

Extenstions>Captcha
Basic Captcha disabled
Google reCAPTCHA enabled and both Site and Secret keys installed.
System>Settings>Site>Options>Captcha
Set to Google recaptcha

Searching the page source, the google recaptcha code is NOT Present BUT a second telephone input field now appears (coming from the google recaptcha template).

If you complete the form (have to add telephone twice?), you get:

Code: Select all

Syntak Error: invalid character
OK
Notice: Undefined index: g-recaptcha-response in /home/xxxxx/public_html/estore/catalog/controller/google_captcha.php on line 32 {error:{"captcha":"Verification code does not match the image"}}
So, it looks like OpenCart thinks that the google recaptcha is there, but it isn't.

Any thoughts?

Thanx

PS. Opencart 2.1.0.1

Attachments

ResisterPage.jpg

Register page with invisible captcha - ResisterPage.jpg (99.95 KiB) Viewed 8662 times


Newbie

Posts

Joined
Mon Nov 30, 2015 12:16 pm

Post by thbr02 » Fri Feb 26, 2016 9:44 pm

Did you solve this error? I get exactly the same error at my site. I'm using Opencart 2.1.0.2. There must be other shops with the same error out there.

Active Member

Posts

Joined
Wed Jun 22, 2011 10:30 pm
Location - Sweden

Post by N00bie » Fri Feb 26, 2016 11:33 pm

No, you are the first one to respond at all.
Maybe this will bounce it up and we will get some sort of response.
Like you said, we cannot be the only ones!

Newbie

Posts

Joined
Mon Nov 30, 2015 12:16 pm

Post by thbr02 » Sun Feb 28, 2016 12:39 am

When I comment out the <?php echo $captcha; ?> at line 284 at checkout/register.tpl the telphone field disappears. So there is some kind of connection.

Active Member

Posts

Joined
Wed Jun 22, 2011 10:30 pm
Location - Sweden

Post by N00bie » Sun Feb 28, 2016 3:51 am

Exactly, it is there just invisible - telephone input is being displayed rather than the captcha.
I don't think anyone knows how to solve this problem?

Newbie

Posts

Joined
Mon Nov 30, 2015 12:16 pm

Post by Randem » Sun Feb 28, 2016 3:57 am

Hi

Do you have some third party software installed or you may have changed the code for there is no such program at catalog/controller/google_captcha.php it is at catalog/controller/captcha/google_captcha.php. Change the code to reflect the proper path. I have searched the whole installation and i find no reference to a bad path...

Debugging - http://www.randemsystems.com/support/op ... rt-system/

Was this an upgrade or a new install?

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by thbr02 » Sun Feb 28, 2016 4:11 am

I didn't look careful enough about the first post above. The error message at my site is not the same. It's like this:

PHP Notice: Undefined index: g-recaptcha-response in /home/torshammar/domains/XXXXX/public_html/catalog/controller/captcha/google_captcha.php on line 32

Active Member

Posts

Joined
Wed Jun 22, 2011 10:30 pm
Location - Sweden

Post by Randem » Sun Feb 28, 2016 4:25 am

Ok, so it cannot be the same error message... What is yours?

but the other question still remains... ???

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by thbr02 » Sun Feb 28, 2016 4:39 am

My error is just the same as N00bie's No captcha and a telephonenumber field instead. Just a difference in the error message. (the part colored in red below)

PHP Notice: Undefined index: g-recaptcha-response in /home/torshammar/domains/XXXXX/public_html/catalog/controller/captcha/google_captcha.php on line 32

Active Member

Posts

Joined
Wed Jun 22, 2011 10:30 pm
Location - Sweden

Post by jamesg » Sun Feb 28, 2016 4:48 am

I'm having this exact same issue on a fresh install

Newbie

Posts

Joined
Thu Feb 18, 2016 4:23 am

Post by Randem » Sun Feb 28, 2016 4:51 am

Ok, my role has changed to dentist... Is this an upgrade or new install?
What do you have installed? (MODS / Extensions / Themes)

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by thbr02 » Sun Feb 28, 2016 4:58 am

It's an upgrade from 2.0.3.1. I think Iv'e followed the most of the tips from your site about upgrading. I have quite a lot of vqmods and ocmods installed, but Iv'e tried to disable those who have affect on the checkout/register.php. Custom theme, but hav also tried with default theme. And the message tells that no changed are done at the controller by any mod.

PHP Notice: Undefined index: g-recaptcha-response in /home/torshammar/domains/XXXXX/public_html/catalog/controller/captcha/google_captcha.php on line 32

Active Member

Posts

Joined
Wed Jun 22, 2011 10:30 pm
Location - Sweden

Post by thbr02 » Sun Feb 28, 2016 5:04 am

The line in the controller that looks like this:

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']);

Active Member

Posts

Joined
Wed Jun 22, 2011 10:30 pm
Location - Sweden

Post by Randem » Sun Feb 28, 2016 5:25 am

g-recaptcha-response is a response from Google. It is a newly created field from Google, so my guess is that there is a problem in the form that supports the capture. It also seems that the telephone input will not be shown if the route is not in checkout you will then get a capture error.

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by N00bie » Sun Feb 28, 2016 6:05 am

The error I originally posted did have a couple mods added, BUT I get the same error/problem with a clean install on a different domain. I am not sure the path is the same as I originally posted or the same as thbr02 (or maybe I copied error path wrong), but since I have the same problem with a clean install under a differtent domain suggests that is not the path issue.

Kinda of makes me think a php setting or something, although I can install google re-captcha manually on other sites on the same server (it is my leased server) so that kind of rules that out and suggests a opencart issue.

Newbie

Posts

Joined
Mon Nov 30, 2015 12:16 pm

Post by Randem » Sun Feb 28, 2016 6:16 am

How you you get Google Capture to work? I installed and enabled it and nothing happens anywhere not even an error.

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by Randem » Sun Feb 28, 2016 6:38 am

I found this on Google - https://github.com/opencart/opencart/issues/3919
it does work...

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by thbr02 » Sun Feb 28, 2016 4:35 pm

Ok, good job, now I'm a bit on the way. I found the telephone field in the google_captcha.tpl and replaced the whole code with the code at your link. Unfortunately I get an error and the page won't load at all. So for now Iv'e just replaced the code

Code: Select all

 <label class="control-label" for="input-payment-telephone">Telephone</label>
  <input type="text" name="telephone" value="" placeholder="Telephone" id="input-payment-telephone" class="form-control">
at line 3 and 4 with the line 3 and 4 in your link.

Code: Select all

<label class="control-label" for="input-captcha"><?php echo $entry_captcha; ?></label>
    <div id="input-captcha" class="g-recaptcha" data-sitekey="<?php echo $site_key; ?>"></div>
The captcha is still not visible.

Active Member

Posts

Joined
Wed Jun 22, 2011 10:30 pm
Location - Sweden

Post by thbr02 » Sun Feb 28, 2016 4:39 pm

This is the way the original google_captcha.tpl looks like:

Code: Select all

div class="form-group required">
  <?php if (substr($route, 0, 9) == 'checkout/') { ?>
  <label class="control-label" for="input-payment-telephone">Telephone</label>
  <input type="text" name="telephone" value="" placeholder="Telephone" id="input-payment-telephone" class="form-control">
  <?php } else { ?>
  <div class="col-sm-offset-2 col-sm-10">
    <div class="g-recaptcha" data-sitekey="<?php echo $site_key; ?>"></div>
    <?php if ($error_captcha) { ?>
    <div class="text-danger"><?php echo $error_captcha; ?></div>
    <?php } ?>
  </div>
  <?php } ?>
</div>
I dont' know why the telephone field is placed there at all.

Active Member

Posts

Joined
Wed Jun 22, 2011 10:30 pm
Location - Sweden

Post by Randem » Sun Feb 28, 2016 4:44 pm

I don't understand what you mean, you replace the whole contents of the file with the code from the link. I have done it already and it works properly. If you cannot get it to work then you have some other code that is interfering.

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am
Who is online

Users browsing this forum: Amazon [Bot] and 49 guests