Skip to content

Commit

Permalink
Merge pull request #1278 from sandergo90/fix/urlchooserajax
Browse files Browse the repository at this point in the history
[AdminListBundle]: urlchooser ajax requests
  • Loading branch information
Kristof Jochmans authored Aug 29, 2016
2 parents 40d7911 + 6477a99 commit 9020c58
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,12 @@ protected function doEditAction(AbstractAdminListConfigurator $configurator, $en
$this->container->get('event_dispatcher')->dispatch(AdminListEvents::POST_EDIT, new AdminListEvent($helper));
$indexUrl = $configurator->getIndexUrl();

return new RedirectResponse(
$this->generateUrl($indexUrl['path'], isset($indexUrl['params']) ? $indexUrl['params'] : array())
);
// Don't redirect to listing when coming from ajax request, needed for url chooser.
if (!$request->isXmlHttpRequest()) {
return new RedirectResponse(
$this->generateUrl($indexUrl['path'], isset($indexUrl['params']) ? $indexUrl['params'] : array())
);
}
}
}

Expand Down

0 comments on commit 9020c58

Please sign in to comment.