From d5dc0d6e3cc4e9230bcca7ce7f0317c2de8ba713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Prunayre?= Date: Tue, 10 Dec 2024 10:50:59 +0100 Subject: [PATCH] Editor / Add support for conditional default view When creating an editor configuration with more than one default view an exception is returned. ``` Error on line 82 of edit.xsl: XPTY0004: A sequence of more than one item is not allowed as the second argument of concat() ``` Instead, select the first default view defined. Also add support for conditionally defined default views: ```xml
``` --- web/src/main/webapp/xslt/common/base-variables-metadata.xsl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/src/main/webapp/xslt/common/base-variables-metadata.xsl b/web/src/main/webapp/xslt/common/base-variables-metadata.xsl index 1ea889b8235..73b2f683f62 100644 --- a/web/src/main/webapp/xslt/common/base-variables-metadata.xsl +++ b/web/src/main/webapp/xslt/common/base-variables-metadata.xsl @@ -106,10 +106,11 @@ then /root/request/currTab else if (/root/gui/currTab != '') then /root/gui/currTab - else $editorConfig/editor/views/view[@default]/tab[ + else ($editorConfig/editor/views/view[@default and + gn-fn-metadata:check-elementandsession-visibility($schema, $metadata, $serviceInfo, @displayIfRecord, @displayIfServiceInfo)]/tab[ @default and gn-fn-metadata:check-elementandsession-visibility($schema, $metadata, $serviceInfo, @displayIfRecord, @displayIfServiceInfo) - ]/@id"/> + ]/@id)[1]"/>