Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update reCAPTCHA v3 to not use obsolete GetSetting method #557

Closed
bjarnef opened this issue May 10, 2021 · 2 comments
Closed

Update reCAPTCHA v3 to not use obsolete GetSetting method #557

bjarnef opened this issue May 10, 2021 · 2 comments

Comments

@bjarnef
Copy link

bjarnef commented May 10, 2021

Currently in Umbraco Forms v8.7.1 it seems the Fieldtype.Recaptcha3.cshtml is using the obsolete method to get a setting:

var siteKey = Umbraco.Forms.Core.Configuration.GetSetting("RecaptchaV3SiteKey");

Before reCAPTCHA v3 was added to Umbraco Forms in v8.7 I had this in a custom reCAPTCHA v3 field:

var configuration = Current.Factory.GetInstance<Umbraco.Forms.Core.IFacadeConfiguration>();
var siteKey = configuration.GetSetting("RecaptchaPublicKey");

It would be great to use this to not use the obsolete method.

@bjarnef bjarnef changed the title Update reCAPTCHA v3 to use Update reCAPTCHA v3 to not use obsolete GetSetting method May 10, 2021
@AndyButland
Copy link

What you have is better @bjarnef I agree, but although obsolete, this other method won't be removed in a V8 release. And for V9, we have had to change configuration access anyway (to use IOptions and appSettings,json. So I don't think we need to be too concerned about this.

@bjarnef
Copy link
Author

bjarnef commented May 10, 2021

Agree we don't need to remove the method as it would be a breaking change and developer may use the obsolete GetSetting() method in custom fields.
However I guess it should be fine to update the Fieldtype.Recaptcha3.cshtml included in Umbraco Forms to use the new way to fetch a setting? The GetSetting was obsolete before Umbraco 8.7, but not sure since which version is has been marked as obsolete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants