Skip to content

Commit

Permalink
fixes a bug when editing a menu item outside of a modal
Browse files Browse the repository at this point in the history
  • Loading branch information
gmanen committed Apr 3, 2014
1 parent f18d2f7 commit 3a5d75d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Controller/CrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ protected function doNew(Request $request)
$entityClass = $this->getEntityClass();
$entity = new $entityClass();
$form = $this->createForm($this->getFormType(), $entity);
$action = $this->generateUrl($this->getRouteNameForAction('new'));
$action = $this->generateUrl($this->getRouteNameForAction('new'), array('layout' => $request->get('layout', null)));

if ('POST' === $request->getMethod()) {
$form->handleRequest($request);
Expand Down Expand Up @@ -332,7 +332,7 @@ protected function doEdit(Request $request, $id)
}

$form = $this->createForm($this->getFormType(), $entity);
$action = $this->generateUrl($this->getRouteNameForAction('edit'), array('id' => $entity->getId()));
$action = $this->generateUrl($this->getRouteNameForAction('edit'), array('id' => $entity->getId(), 'layout' => $request->get('layout', null)));

if ('POST' === $request->getMethod()) {
$form->handleRequest($request);
Expand Down

0 comments on commit 3a5d75d

Please sign in to comment.