diff --git a/controllers/grid/users/subscriberSelect/SubscriberSelectGridHandler.php b/controllers/grid/users/subscriberSelect/SubscriberSelectGridHandler.php index 215b8faad54..e1b3e449e94 100644 --- a/controllers/grid/users/subscriberSelect/SubscriberSelectGridHandler.php +++ b/controllers/grid/users/subscriberSelect/SubscriberSelectGridHandler.php @@ -65,11 +65,13 @@ public function initialize($request, $args = null) { parent::initialize($request, $args); + $builder = UserGroup::withContextIds([$request->getContext()->getId()]); $stageId = $this->getAuthorizedContextObject(Application::ASSOC_TYPE_WORKFLOW_STAGE); - $userGroups = Repo::userGroup()->getUserGroupsByStage( - $request->getContext()->getId(), - $stageId - ); + if ($stageId) { + $builder->withStageIds([$stageId]); + } + $userGroups = $builder->get(); + $this->_userGroupOptions = []; foreach ($userGroups as $userGroup) { $this->_userGroupOptions[$userGroup->id] = $userGroup->getLocalizedData('name');