Return save and close from variant to parent

This commit is contained in:
Wojtek
2026-10-16 10:28:31 +02:00
parent 0f1bd3e9fe
commit defdfcb32f
4 changed files with 16 additions and 2 deletions
@@ -17,6 +17,19 @@ class SetController extends FormController
$this->setRedirect('index.php?option=com_testquestions&view=set&layout=edit&parent_id=' . $parentId);
}
public function save2close($key = null, $urlVar = null)
{
$formData = (array) $this->input->post->get('jform', [], 'array');
$parentId = (int) ($formData['parent_id'] ?? 0);
$result = parent::save2close($key, $urlVar);
if ($result && $parentId > 0) {
$this->setRedirect('index.php?option=com_testquestions&task=set.edit&id=' . $parentId);
}
return $result;
}
public function cancel($key = null)
{
$parentId = $this->input->getInt('parent_id');