diff --git a/README.md b/README.md
index 222a2ca..4c7ddae 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.37.1).
+W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.37.2).
Po instalacji komponent jest dostępny w panelu administratora jako **Pytania testowe**.
diff --git a/administrator/components/com_testquestions/sql/updates/mysql/1.37.2.sql b/administrator/components/com_testquestions/sql/updates/mysql/1.37.2.sql
new file mode 100644
index 0000000..672597d
--- /dev/null
+++ b/administrator/components/com_testquestions/sql/updates/mysql/1.37.2.sql
@@ -0,0 +1 @@
+-- No database changes required for version 1.37.2.
diff --git a/administrator/components/com_testquestions/src/Controller/SetController.php b/administrator/components/com_testquestions/src/Controller/SetController.php
index 10015f7..8fa633d 100644
--- a/administrator/components/com_testquestions/src/Controller/SetController.php
+++ b/administrator/components/com_testquestions/src/Controller/SetController.php
@@ -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;
diff --git a/com_testquestions.xml b/com_testquestions.xml
index 6bf3db6..8520fd3 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.37.1
+ 1.37.2
COM_TESTQUESTIONS_DESCRIPTION
com_testquestions
Komponent\Component\Testquestions