diff --git a/administrator/components/com_menus/controllers/menu.php b/administrator/components/com_menus/controllers/menu.php index c958463c095f7..522e55755517c 100644 --- a/administrator/components/com_menus/controllers/menu.php +++ b/administrator/components/com_menus/controllers/menu.php @@ -59,7 +59,7 @@ public function save($key = null, $urlVar = null) JFactory::getApplication()->enqueueMessage($msg, 'error'); // Redirect back to the edit screen. - $this->setRedirect(JRoute::_('index.php?option=com_menus&view=menu&layout=edit', false)); + $this->setRedirect(JRoute::_('index.php?option=com_menus&view=menu&layout=edit' . $this->getRedirectToItemAppend($recordId), false)); return false; } @@ -103,7 +103,7 @@ public function save($key = null, $urlVar = null) $app->setUserState($context . '.data', $data); // Redirect back to the edit screen. - $this->setRedirect(JRoute::_('index.php?option=com_menus&view=menu&layout=edit', false)); + $this->setRedirect(JRoute::_('index.php?option=com_menus&view=menu&layout=edit' . $this->getRedirectToItemAppend($recordId), false)); return false; } @@ -123,7 +123,7 @@ public function save($key = null, $urlVar = null) // Redirect back to the edit screen. $this->setMessage(JText::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED', $model->getError()), 'error'); - $this->setRedirect(JRoute::_('index.php?option=com_menus&view=menu&layout=edit', false)); + $this->setRedirect(JRoute::_('index.php?option=com_menus&view=menu&layout=edit' . $this->getRedirectToItemAppend($recordId), false)); return false; } @@ -155,6 +155,7 @@ public function save($key = null, $urlVar = null) // Set the record data in the session. $recordId = $model->getState($this->context . '.id'); $this->holdEditId($context, $recordId); + $app->setUserState($context . '.data', null); // Redirect back to the edit screen. $this->setRedirect(JRoute::_('index.php?option=com_menus&view=menu&layout=edit' . $this->getRedirectToItemAppend($recordId), false));