bvandorp / noCaptcha

MODx FormIt hook for the new noCaptcha reCaptcha from Google
13 stars 4 forks source link

system/context settings #2

Closed Jako closed 9 years ago

Jako commented 9 years ago
$site_key = $modx->getOption('formit.recaptcha_public_key', $scriptProperties, '');

should be

$site_key = $modx->getOption('formit.recaptcha_public_key', null, '');

if you want to use system/context settings for that.

bvandorp commented 9 years ago

Thanks, otherwise it can be overwritten by snippet properties? Am I correct?

Jako commented 9 years ago

In my opinion it will not get system/context settings with the first line. (Edit: it looks first in snippet parameters and then in system/context settings)

$xxx = $modx->getOption('xxx', null, $modx->getOption('xxx', $scriptProperties, ''));

is used by a lot of snippets to get system/context settings and if not set snippet parameters.

bvandorp commented 9 years ago

It did work on my test but I'll change it :)

Jako commented 9 years ago
$xxx = $modx->getOption('xxx', $scriptProperties, '');

Will get first snippet settings and then system/context settings.

Depends on what you want.

bvandorp commented 9 years ago

Yes, but this will always be a system-setting since its the same system-setting as used by the formit captcha hook. So this is the best solution for now. Thanks for explaining!