Support for multiple reCAPTCHAs on one page

Posted: January 11, 2019 at 3:21 AM Quote #217895
Hello,

I was working on implementing a reCaptcha in one of our products and faced a really bad problem. The plugin I was working on was integrating on a page that already has a reCaptcha and that causes an error: "Uncaught Error: reCAPTCHA has already been rendered in this element".

The error is caused by the fact that both of the reCaptchas controls had the same id in the HTML - "recaptcha". If the reCaptcha elements have different id's there would be no problem to have several of the on one page.
I've dug in nopCommerce source code and found the GenerateCaptcha method in Nop.Web.Framework\Security\Captcha\HtmlExtensions.cshtml file. In line 45 an id of "recaptcha" is set for the Id property when creating a new GRecaptchControl. If a unique string is passed each time a new control is created this issue would not be present.

Regards,
Anton
This post/answer is useful
1
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
www.Nop-Templates.com - the best place for nopCommerce themes and plugins

Follow us on
Facebook: http://www.facebook.com/NopTemplates
Twitter: http://twitter.com/NopTemplates
Blog: http://www.nop-templates.com/blog

www.Nop-Templates.com
nopCommerce Solution Partners
Posted: January 14, 2019 at 2:26 AM Quote #217967
Thanks for the suggestion. Here is a work item.
This post/answer is useful
2
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: January 21, 2019 at 5:24 AM Quote #218174
Solved. Please see this commit
This post/answer is useful
2
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: January 22, 2019 at 3:00 AM Quote #218223
Hi,

Thank you for the quick fixes!

Regards,
Anton
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
www.Nop-Templates.com - the best place for nopCommerce themes and plugins

Follow us on
Facebook: http://www.facebook.com/NopTemplates
Twitter: http://twitter.com/NopTemplates
Blog: http://www.nop-templates.com/blog

www.Nop-Templates.com
nopCommerce Solution Partners
Posted: February 18, 2019 at 1:28 AM Quote #221089
Thank you very much for your attention.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Premium support services
  • Dedicated premium support services provided by core developers are intended for persons who run mission critical websites, work on projects with tight deadlines, or want to get dedicated support.
Professional services
  • Want to open a new store? Want to take your store to the next level? Need a custom extension? We can customize nopCommerce to fit your store perfectly. Request a quote to get started.