input->getInt('parent_id'); $this->setRedirect('index.php?option=com_testquestions&view=set&layout=edit&parent_id=' . $parentId); } public function cancel($key = null) { $parentId = $this->input->getInt('parent_id'); $formData = (array) $this->input->post->get('jform', [], 'array'); $parentId = (int) ($formData['parent_id'] ?? $parentId); if ($parentId < 1) { $itemId = $this->input->getInt('id'); if ($itemId > 0) { $item = $this->getModel()->getItem($itemId); $parentId = (int) ($item->parent_id ?? 0); } } if ($parentId > 0) { $this->setRedirect('index.php?option=com_testquestions&task=set.edit&id=' . $parentId); return true; } $this->setRedirect('index.php?option=com_testquestions&view=sets'); return true; } }