-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Not a defect
-
Affects Version/s: 6.5.0.2
-
Fix Version/s: None
-
Component/s: Module - Managed Objects
-
Labels:
-
Environment:6.5.0.2
-
Support Ticket IDs:
Steps to reproduce
- Install 6.5.0.2 (reproduced on 6.5.0.4 as well)
- Ran with ./startup.sh -p sample/sync-with-csv. You can use whatever you feel like
- Go to Configure > Managed Objects and edit the User
- Add a testArray, label “Test Array” and for type, select Array and keep the defaults for advance options except for Searchable so you are able to see values in User List view
- Click Manage > User and Add a user. I created test1 as an example and save
- Edit the user and add entries into the array. I added two values: 1 & 2
- I see them in User List view. Test Array shows as 1, 2
- Go back and edit user and change the value for 2 in the array to a 1. So we should see 1, 1. What happens is when you hit save, you are left with only 1 value in the array. Admin UI keeps the values in the array unique
Next we use REST to patch the user:
1). Patch:
http://localhost:8080/openidm/managed/user/7b6f33fb-b6f3-4a4a-8ed1-0a38f8c3899e
2) payload:
[
{ "operation": "add", "field": "/testArray/-", "value": "2" }]
3) result:
"testArray": [
"1",
"2"
]
}
4) rerun the patch and get the following results
"testArray": [
"1",
"2",
"2"
]
Note that I can add as many values of the same thing. If I go back to User List, I will see 1, 2, 2 for Test Array. We should not be allowing duplicates. It should work the same as in the UI.