From 595c96d1e2f20dd4c1df512f0aacffa2b801bd27 Mon Sep 17 00:00:00 2001 From: passchn <77938819+passchn@users.noreply.github.com> Date: Sun, 29 Oct 2023 21:35:40 +0100 Subject: [PATCH] set FormProtection config only if the component is loaded --- src/Controller/FilePoolAssetsController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Controller/FilePoolAssetsController.php b/src/Controller/FilePoolAssetsController.php index 4b9d31c..68a2246 100644 --- a/src/Controller/FilePoolAssetsController.php +++ b/src/Controller/FilePoolAssetsController.php @@ -24,9 +24,11 @@ public function beforeFilter(EventInterface $event) { parent::beforeFilter($event); - $this->FormProtection->setConfig('unlockedActions', [ - 'index', 'add', 'view', 'edit', 'delete', - ]); + if ($this->components()->has('FormProtection')) { + $this->FormProtection->setConfig('unlockedActions', [ + 'index', 'add', 'view', 'edit', 'delete', + ]); + } } /**