diff --git a/src/Controller/Component/ContactUsComponent.php b/src/Controller/Component/ContactUsComponent.php index 8d62b74..188619e 100644 --- a/src/Controller/Component/ContactUsComponent.php +++ b/src/Controller/Component/ContactUsComponent.php @@ -83,7 +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')) { + if (Configure::read('ContactUs.fields.turnstile') && + $this->getController()->components()->has('FormProtection') && + method_exists($this->getController()->components()->get('FormProtection'), 'unlockFields') + ) { $this->getController()->components()->get('FormProtection') ->unlockFields('cf-turnstile-response'); }