When you assign and remove a role from a user.
The user gets removed from {domain_editor}
I think the reason can be found in domain_user , case 'update'.
If edit['domain_user'] is empty, it doesn't mean that no domain is assigned.
I solved this by wrapping the code in case 'update':
case 'update':
if( isset($edit['domain_user'])){
..
}
break;
this seems to solve the issue, but I haven't verified it thoroughly.
Can someone confirm this bug?
if not I have done something funky with the code =)
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 412078-d6-user.patch | 2.24 KB | agentrickard |
| #7 | 412078-d5-user.patch | 2.25 KB | agentrickard |
| #6 | 412078-domain-user.patch | 801 bytes | agentrickard |
Comments
Comment #1
agentrickardFrom which form are you assigning the role?
Comment #2
agentrickardComment #3
jolos commentedSorry for the not so fast reaction.
I'm doing this from admin/user/user.
Some more clarification on what I'm doing:
(1) I disable my custom modules
(2) I select a user
(3) I ensure this user is assigned to a domain.
(4) in admin/user/user I assign a role to the user
(5) the role gets assigned
(6) I check the domains of the user, and I see that the only domain assigned to the user is the primary domain.
Comment #4
agentrickardAnd you're entering that formed from the primary domain?
We probably are not accounting for how the batch form interacts with hook_user.
Comment #5
jolos commentedI was doing this from the primary domain. When I assign the role on a secondary domain the problem doesn't occur.
Comment #6
agentrickardNice catch. We should have seen this earlier.
Committed to HEAD.
Comment #7
agentrickardHere is a D5 patch, which also catches a similar error in Domain User.
Comment #8
agentrickardRevised version of the D6 patch.