From 952870aa59b9b8e62f1bb87ada95fc9d2aebcfa4 Mon Sep 17 00:00:00 2001 From: Satyam Valjibhai Mangroliya <93871216+satyammangroliya@users.noreply.github.com> Date: Mon, 25 Aug 2025 15:45:47 +0200 Subject: [PATCH] Fix undefined set_id error on Configure tab by passing null if parameter is missing --- classes/UDFCheck/class.UDFCheckGUI.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/classes/UDFCheck/class.UDFCheckGUI.php b/classes/UDFCheck/class.UDFCheckGUI.php index 6165e93..5dca326 100644 --- a/classes/UDFCheck/class.UDFCheckGUI.php +++ b/classes/UDFCheck/class.UDFCheckGUI.php @@ -44,7 +44,15 @@ public function __construct($parent_gui) $this->pl = ilUserDefaultsPlugin::getInstance(); $this->ctrl->saveParameter($this, self::IDENTIFIER_CATEGORY); $this->ctrl->saveParameter($this, self::IDENTIFIER); - $this->ctrl->setParameter($this, UserSettingsGUI::IDENTIFIER, $_GET[UserSettingsGUI::IDENTIFIER]); + // When clicking on the "Configure" tab, the set_id may be undefined. + // To prevent errors, we pass a null value if the parameter is not set. + if (isset($_GET[UserSettingsGUI:: IDENTIFIER])) { + $this->ctrl->setParameter($this, UserSettingsGUI::IDENTIFIER, $_GET[UserSettingsGUI::IDENTIFIER]); + } + else{ + $this->ctrl->setParameter($this, UserSettingsGUI:: IDENTIFIER, null); + } + $this->ctrl->saveParameter($parent_gui, UserSettingsGUI::IDENTIFIER); }