From fe7017544bc9190c490a651c85f6ae113ecc9254 Mon Sep 17 00:00:00 2001 From: Cameron Bryers <12287346+Cambis@users.noreply.github.com> Date: Tue, 13 Aug 2024 09:25:01 +1200 Subject: [PATCH] MNT: Minor code cleanup --- src/Admin/AdvancedWorkflowAdmin.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Admin/AdvancedWorkflowAdmin.php b/src/Admin/AdvancedWorkflowAdmin.php index 72412820..14420b7d 100644 --- a/src/Admin/AdvancedWorkflowAdmin.php +++ b/src/Admin/AdvancedWorkflowAdmin.php @@ -20,6 +20,8 @@ use SilverStripe\ORM\ArrayList; use SilverStripe\ORM\DataList; use SilverStripe\ORM\DataObject; +use SilverStripe\ORM\Filterable; +use SilverStripe\ORM\SS_List; use SilverStripe\Security\Member; use SilverStripe\Security\Permission; use SilverStripe\Security\Security; @@ -180,7 +182,7 @@ public function getFieldDependentData(Member $user, string $fieldName): ?DataLis $list = null; if ($fieldName === 'PendingObjects') { - $list = $this->getWorkflowService()->userPendingItems($user); + $list = $this->getWorkflowService()->userPendingItems($user); } if ($fieldName === 'SubmittedObjects') { @@ -188,7 +190,7 @@ public function getFieldDependentData(Member $user, string $fieldName): ?DataLis } // If the list is null, then the user has entered a bad input - if (!$list instanceof DataList && !$list instanceof ArrayList) { + if (!$list instanceof Filterable) { throw new InvalidArgumentException('$fieldName must be one of ("PendingObjects", "SubmittedObjects")'); }