From 579926af751d78db88290a4a79a42d151d776013 Mon Sep 17 00:00:00 2001 From: Sergej Riel Date: Tue, 9 Dec 2025 12:10:56 +0100 Subject: [PATCH] Fix: multiple error windows tabs fix. - Widgets inside the Error Tabs got id rework. --- CommonLogic/DataQueries/SqlDataQuery.php | 1 + CommonLogic/DataSheets/DataSheet.php | 1 + Exceptions/ExceptionTrait.php | 6 ++++++ Widgets/Parts/CodeFormatter.php | 2 +- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CommonLogic/DataQueries/SqlDataQuery.php b/CommonLogic/DataQueries/SqlDataQuery.php index 19ed02a15..3c4b64872 100644 --- a/CommonLogic/DataQueries/SqlDataQuery.php +++ b/CommonLogic/DataQueries/SqlDataQuery.php @@ -210,6 +210,7 @@ public function createDebugWidget(DebugMessage $debug_widget) $inputCode_widget = WidgetFactory::createFromUxonInParent($sql_tab, new UxonObject([ 'widget_type' => 'InputCode', + 'id' => $debug_widget->getId() . '_SqlDataQuery_InputCode', 'width' => '100%', 'height' => '100%', "language" => 'sql', diff --git a/CommonLogic/DataSheets/DataSheet.php b/CommonLogic/DataSheets/DataSheet.php index 511282ada..d254495b3 100644 --- a/CommonLogic/DataSheets/DataSheet.php +++ b/CommonLogic/DataSheets/DataSheet.php @@ -3395,6 +3395,7 @@ public function createDebugWidget(DebugMessage $debug_widget, string $tabCaption $debugSheet = $this->createDebugSheet(); $uxon_widget = WidgetFactory::createFromUxonInParent($uxon_tab, new UxonObject([ 'widget_type' => 'InputUxon', + 'id' => $debug_widget->getId() . '_DataSheet_InputUxon', 'caption' => PhpClassDataType::findClassNameWithoutNamespace(get_class($this)), 'hide_caption' => true, 'width' => '100%', diff --git a/Exceptions/ExceptionTrait.php b/Exceptions/ExceptionTrait.php index 6a66449c4..cdd3511b8 100644 --- a/Exceptions/ExceptionTrait.php +++ b/Exceptions/ExceptionTrait.php @@ -104,6 +104,11 @@ public function createWidget(UiPageInterface $page) public function createDebugWidget(DebugMessage $debug_widget) { $page = $debug_widget->getPage(); + + // Appends the exception ID only once for preventing IDs like: DebugMessage_ID_ID_ID... + if (!str_contains($debug_widget->getId(), $this->getId())) { + $debug_widget->setId($debug_widget->getId() . '_' . $this->getId()); + } $translator = $debug_widget->getWorkbench()->getCoreApp()->getTranslator(); // Add a tab with a user-friendly error description if ($debug_widget->findChildById('error_tab') === false) { @@ -204,6 +209,7 @@ public function createDebugWidget(DebugMessage $debug_widget) $context_tab->setCaption($translator->translate('ERROR.CONTEXT_CAPTION')); $context_tab->addWidget(WidgetFactory::createFromUxonInParent($context_tab, new UxonObject([ 'widget_type' => 'InputUxon', + "id" => $debug_widget->getId() . '_' . $context_tab->getId() . '_InputUxon', 'disabled' => true, 'width' => '100%', 'height' => '100%', diff --git a/Widgets/Parts/CodeFormatter.php b/Widgets/Parts/CodeFormatter.php index ab79343ce..88f1c5ca8 100644 --- a/Widgets/Parts/CodeFormatter.php +++ b/Widgets/Parts/CodeFormatter.php @@ -98,7 +98,7 @@ public function getDialect() : ?string * Sets the dialect for formatted language. Example: language: "sql" and dialect: "tsql". * * @uxon-property dialect - * @uxon-type [sql,tsql mariadb,mysql,plsql,postgresql] + * @uxon-type [sql,tsql,mariadb,mysql,plsql,postgresql] * * @param string $dialect * @return $this