em = $entityManager; $this->adminUrlGenerator = $adminUrlGenerator; } public static function getSubscribedEvents() { return [ AfterCrudActionEvent::class => ['overrideSortAction'], ]; } public function overrideSortAction(AfterCrudActionEvent $event) { $actions = $event->getResponseParameters()->get('global_actions'); if ($actions) { foreach ($actions as $action) { if ($action->getName() == 'sort') { $entityId = $event->getAdminContext()->getRequest()->get('entityId'); if ($entityId != null) { $url = $this->adminUrlGenerator ->setController($event->getAdminContext()->getCrud()->getControllerFqcn()) ->setAction($action->getName()) ->set('entityId', $entityId) ->generateUrl(); $action->setLinkUrl($url); } } } } } }