DieSchittigs / recaptcha-bundle

reCAPTCHA replacement for Contao 4
ISC License
7 stars 6 forks source link

Improve handling of palettes in DCA (fixes #10) #14

Closed bennyborn closed 4 years ago

Songworks commented 4 years ago

@bennyborn Thanks for fixing this. I don't suppose you could also fix #11 along with it? The last part with if (Config::get('recaptchaType') != 'recaptcha3') return; within dca/tl_form_fields.php would need to be changed to something more like:

if (Config::get('recaptchaType') === 'recaptcha3') {
  $GLOBALS['TL_DCA']['tl_form_field']['palettes']['captcha'] = str_replace(',type,label', ',type,label,recaptcha3_threshold,recaptcha3_action', $GLOBALS['TL_DCA']['tl_form_field']['palettes']['captcha']);
}

For example.

bennyborn commented 4 years ago

@bennyborn Thanks for fixing this. I don't suppose you could also fix #11 along with it?

Actually it seems like the integration into tl_form_field was pretty faulty to begin with. Not only did the return statement kill everything but someone mislabeled the threshold field naming it recaptch3_threshold - missing an a.

I guess it should be fine now :)

Edit: Sorry, had some dump calls in the last commit.