Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ public function execute()
// Validate the posted data.
$return = $model->validate($form, $data);

// Save the posted data in the session.
$this->app->setUserState('com_config.config.global.data', $data);

// Check for validation errors.
if ($return === false)
{
/*
* The validate method enqueued all messages for us, so we just need to redirect back.
*/

// Save the posted data in the session.
$this->app->setUserState('com_config.config.global.data', $data);

// Redirect back to the edit screen.
$this->app->redirect(JRoute::_('index.php?option=com_config&controller=config.display.application', false));
}
Expand All @@ -89,23 +89,26 @@ public function execute()
$data = $return;
$return = $model->save($data);

// Save the validated data in the session.
$this->app->setUserState('com_config.config.global.data', $data);

// Check the return value.
if ($return === false)
{
/*
* The save method enqueued all messages for us, so we just need to redirect back.
*/

// Save the validated data in the session.
$this->app->setUserState('com_config.config.global.data', $data);

// Save failed, go back to the screen and display a notice.
$this->app->redirect(JRoute::_('index.php?option=com_config&controller=config.display.application', false));
}

// Set the success message.
$this->app->enqueueMessage(JText::_('COM_CONFIG_SAVE_SUCCESS'), 'message');

// Clear the data from the session.
$this->app->setUserState('com_config.config.global.data', null);

// Set the redirect based on the task.
switch ($this->options[3])
{
Expand Down