Skip to content

Commit

Permalink
fixed form controller could set redirect url poorly if form had no it…
Browse files Browse the repository at this point in the history
…emid associated with it. If thats the case we now redirect back to the list view on save
  • Loading branch information
pollen8 committed Oct 12, 2011
1 parent c5f255c commit 4085d1d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions components/com_fabrik/controllers/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,14 @@ protected function getRedirectURL($model, $incSession = true)
//return to the page that called the form
$url = urldecode(JRequest::getVar('fabrik_referrer', 'index.php', 'post'));
}
$Itemid = $app->getMenu('site')->getActive()->id;
$Itemid = (int)@$app->getMenu('site')->getActive()->id;
if ($url == '') {
$url = "index.php?option=com_fabrik&Itemid=$Itemid";
if ($Itemid !== 0) {
$url = "index.php?option=com_fabrik&Itemid=$Itemid";
} else {
//no menu link so redirect back to list view
$url = "index.php?option=com_fabrik&view=list&listid=".JRequest::getInt('listid');
}
}
}
$config = JFactory::getConfig();
Expand Down

0 comments on commit 4085d1d

Please sign in to comment.