Fix variant save and close redirect
This commit is contained in:
@@ -0,0 +1 @@
|
||||
-- No database changes required for version 1.37.2.
|
||||
@@ -21,10 +21,18 @@ class SetController extends FormController
|
||||
{
|
||||
$formData = (array) $this->input->post->get('jform', [], 'array');
|
||||
$parentId = (int) ($formData['parent_id'] ?? 0);
|
||||
$itemId = (int) ($formData['id'] ?? $this->input->getInt('id'));
|
||||
$result = parent::save2close($key, $urlVar);
|
||||
|
||||
if ($result && $parentId > 0) {
|
||||
$this->setRedirect('index.php?option=com_testquestions&task=set.edit&id=' . $parentId);
|
||||
if ($result) {
|
||||
if ($itemId > 0) {
|
||||
$item = $this->getModel()->getItem($itemId);
|
||||
$parentId = (int) ($item->parent_id ?? $parentId);
|
||||
}
|
||||
|
||||
if ($parentId > 0) {
|
||||
$this->setRedirect('index.php?option=com_testquestions&task=set.edit&id=' . $parentId);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
Reference in New Issue
Block a user