This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch 3_0_X
in repository https://gitbox.apache.org/repos/asf/syncope.git


The following commit(s) were added to refs/heads/3_0_X by this push:
     new 427d8fad45 [SYNCOPE-1882] Not adding placeholder value for multivalue 
dropdown attributes
427d8fad45 is described below

commit 427d8fad45f6424aaad4d599eac7b459771e1fe5
Author: Francesco Chicchiriccò <[email protected]>
AuthorDate: Wed May 14 12:46:53 2025 +0200

    [SYNCOPE-1882] Not adding placeholder value for multivalue dropdown 
attributes
---
 .../apache/syncope/client/console/wizards/any/PlainAttrs.java    | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git 
a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java
 
b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java
index aa536bb9c3..e48f8f48d4 100644
--- 
a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java
+++ 
b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java
@@ -37,6 +37,7 @@ import org.apache.syncope.common.lib.to.GroupableRelatableTO;
 import org.apache.syncope.common.lib.to.MembershipTO;
 import org.apache.syncope.common.lib.to.PlainSchemaTO;
 import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.AttrSchemaType;
 import org.apache.syncope.common.lib.types.SchemaType;
 import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
 import org.apache.wicket.markup.html.WebMarkupContainer;
@@ -151,7 +152,9 @@ public class PlainAttrs extends 
AbstractAttrs<PlainSchemaTO> {
             Attr attr = new Attr();
             attr.setSchema(schema.getKey());
             if (attrMap.get(schema.getKey()) == null || 
attrMap.get(schema.getKey()).getValues().isEmpty()) {
-                attr.getValues().add("");
+                if (schema.getType() != AttrSchemaType.Dropdown && 
!schema.isMultivalue()) {
+                    attr.getValues().add(StringUtils.EMPTY);
+                }
             } else {
                 attr = attrMap.get(schema.getKey());
             }
@@ -172,7 +175,9 @@ public class PlainAttrs extends 
AbstractAttrs<PlainSchemaTO> {
             Attr attr = new Attr();
             attr.setSchema(schema.getKey());
             if (attrMap.get(schema.getKey()) == null || 
attrMap.get(schema.getKey()).getValues().isEmpty()) {
-                attr.getValues().add(StringUtils.EMPTY);
+                if (schema.getType() != AttrSchemaType.Dropdown && 
!schema.isMultivalue()) {
+                    attr.getValues().add(StringUtils.EMPTY);
+                }
             } else {
                 
attr.getValues().addAll(attrMap.get(schema.getKey()).getValues());
             }

Reply via email to