#1000 Problem modifying multi-valued attribute
Closed: Fixed None Opened 13 years ago by edewata.

Changing one of the values in a multi-valued attribute will cause the other values to disappear.

Steps to reproduce:[[BR]]
1. Add user with multiple emails:[[BR]]

 ipa user-add test --first=Test --last=User\[[BR]]
 --email=test1@example.com --email=test2@example.com[[BR]]
  1. Change one of the emails.[[BR]]

    ipa user-mod test --email=test1@example.com --email=test3@example.com[[BR]]

Note that the unchanged email is also specified in the request.

Actual result:[[BR]]
The output of step #2 shows that the unchanged email (i.e. test1@example.com) has disappeared leaving just the new email (i.e. test3@example.com).

Expected result:[[BR]]
The final result should match the values specified in the user-mod (i.e. test1@example.com and test3@example.com).

Note:[[BR]]
If the operation in step #2 is changed to add a new value, it will work correctly.[[BR]]

ipa user-mod test --email=test1@example.com[[BR]]
--email=test2@example.com --email=test3@example.com[[BR]]

The final result contains all emails listed in the modify operation.


The mod is doing a MOD_REPLACE of just test3@example.com. It recognizes that test2 needs to be dropped but seems to be missing test1.

Ah, the error is in this code:

    elif len(adds) == 1 and len(rems) == 1:
        force_replace = True

Yes, we're adding one and dropping one, but it doesn't mean that's all we're doing.

master: 9f19fb18fe748e97b1ac30a3fb7c5ccf6c8ac6fb

Metadata Update from @edewata:
- Issue assigned to rcritten
- Issue set to the milestone: FreeIPA 2.0.3 RC3 (bug fixing)

7 years ago

Login to comment on this ticket.

Metadata