Skip to content

Commit 559e531

Browse files
committed
fix: remaining calls to deprecated getReferrer method
1 parent da8f4e2 commit 559e531

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Controller/AbstractCrudController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ public function delete(AdminContext $context)
387387
return $event->getResponse();
388388
}
389389

390-
if (null !== $referrer = $context->getReferrer()) {
390+
if (null !== $referrer = $context->getRequest()->headers->get('referrer')) {
391391
return $this->redirect($referrer);
392392
}
393393

@@ -450,7 +450,7 @@ public function batchDelete(AdminContext $context, BatchActionDto $batchActionDt
450450
return $event->getResponse();
451451
}
452452

453-
return $this->redirect($batchActionDto->getReferrerUrl());
453+
return $this->redirect($context->getRequest()->headers->get('referer'));
454454
}
455455

456456
public function autocomplete(AdminContext $context): JsonResponse
@@ -638,7 +638,7 @@ protected function getRedirectResponseAfterSave(AdminContext $context, string $a
638638
->setAction(Action::EDIT)
639639
->setEntityId($context->getEntity()->getPrimaryKeyValue())
640640
->generateUrl(),
641-
Action::SAVE_AND_RETURN => $context->getReferrer()
641+
Action::SAVE_AND_RETURN => $context->getRequest()->headers->get('referer')
642642
?? $this->container->get(AdminUrlGenerator::class)->setAction(Action::INDEX)->generateUrl(),
643643
Action::SAVE_AND_ADD_ANOTHER => $this->container->get(AdminUrlGenerator::class)->setAction(Action::NEW)->generateUrl(),
644644
default => $this->generateUrl($context->getDashboardRouteName()),

0 commit comments

Comments
 (0)