From 0cc1894445ea27a3831e3bb895e44ad7ae526065 Mon Sep 17 00:00:00 2001 From: Brandon Shipley Date: Sat, 14 Nov 2026 18:54:34 -0800 Subject: [PATCH] handle form protection component being loaded - unlock cf turnstile field --- src/Controller/Component/ContactUsComponent.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Controller/Component/ContactUsComponent.php b/src/Controller/Component/ContactUsComponent.php index 4a9ef3b..8d62b74 100644 --- a/src/Controller/Component/ContactUsComponent.php +++ b/src/Controller/Component/ContactUsComponent.php @@ -83,6 +83,10 @@ class ContactUsComponent extends Component { $this->setConfig($config); parent::initialize($config); // TODO: Change the autogenerated stub $this->table = TableRegistry::getTableLocator()->get($this->getConfig('model')); + if (Configure::read('ContactUs.fields.turnstile') && $this->getController()->components()->has('FormProtection')) { + $this->getController()->components()->get('FormProtection') + ->unlockFields('cf-turnstile-response'); + } } /**