This is an automated email from the ASF dual-hosted git repository.
ilgrosso pushed a commit to branch 4_0_X
in repository https://gitbox.apache.org/repos/asf/syncope.git
The following commit(s) were added to refs/heads/4_0_X by this push:
new ffaa682700 [SYNCOPE-1882] Not adding placeholder value for multivalue
dropdown attributes
ffaa682700 is described below
commit ffaa6827008ad78296fd4d17f81ac1b2c94a548b
Author: Francesco Chicchiriccò <[email protected]>
AuthorDate: Wed May 14 12:44:33 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 75d78133dc..334f28c229 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
@@ -36,6 +36,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;
@@ -150,7 +151,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());
}