diff --git a/README.md b/README.md
index c9769a6..8be2305 100644
--- a/README.md
+++ b/README.md
@@ -30,6 +30,6 @@ Szkielet komponentu Joomla 6 do gromadzenia pytań testowych.
## Instalacja
-W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.36.0).
+W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.37.0).
Po instalacji komponent jest dostępny w panelu administratora jako **Pytania testowe**.
diff --git a/administrator/components/com_testquestions/sql/updates/mysql/1.37.0.sql b/administrator/components/com_testquestions/sql/updates/mysql/1.37.0.sql
new file mode 100644
index 0000000..9248c7c
--- /dev/null
+++ b/administrator/components/com_testquestions/sql/updates/mysql/1.37.0.sql
@@ -0,0 +1 @@
+-- No database changes required for version 1.37.0.
diff --git a/administrator/components/com_testquestions/src/Controller/SetController.php b/administrator/components/com_testquestions/src/Controller/SetController.php
index 696c1c0..3b164cb 100644
--- a/administrator/components/com_testquestions/src/Controller/SetController.php
+++ b/administrator/components/com_testquestions/src/Controller/SetController.php
@@ -19,6 +19,24 @@ class SetController extends FormController
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;
diff --git a/com_testquestions.xml b/com_testquestions.xml
index b248fe7..858a919 100644
--- a/com_testquestions.xml
+++ b/com_testquestions.xml
@@ -4,7 +4,7 @@
2026-10-14
Komponent
GNU General Public License version 2 or later
- 1.36.0
+ 1.37.0
COM_TESTQUESTIONS_DESCRIPTION
com_testquestions
Komponent\Component\Testquestions