Skip to content

Commit 0c1d221

Browse files
committed
Minor tweak
1 parent e9f8ee6 commit 0c1d221

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Controller/AbstractCrudController.php

Lines changed: 3 additions & 2 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->getRequest()->headers->get('referrer')) {
390+
if (null !== $referrer = $context->getRequest()->headers->get('referer')) {
391391
return $this->redirect($referrer);
392392
}
393393

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

453-
return $this->redirect($context->getRequest()->headers->get('referer'));
453+
// resetting the page number is needed because after deleting some entities, the pagination will change
454+
return $this->redirect($this->container->get(AdminUrlGenerator::class)->setAction(Action::INDEX)->set(EA::PAGE, 1)->generateUrl());
454455
}
455456

456457
public function autocomplete(AdminContext $context): JsonResponse

0 commit comments

Comments
 (0)