Skip to content

Commit

Permalink
set FormProtection config only if the component is loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
passchn committed Oct 29, 2023
1 parent 765a1d5 commit 595c96d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Controller/FilePoolAssetsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
]);
}
}

/**
Expand Down

0 comments on commit 595c96d

Please sign in to comment.