Possible to merge a user with itself
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Fix Released
|
Medium
|
Unassigned | ||
3.0 |
Fix Released
|
Medium
|
Unassigned | ||
3.1 |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Evergreeen: 3.0, 3.1, Master
OpenSRF: N/A
Postgres: N/A
It is possible to merge a user with itself using the actor.usr_merge database function. The result of doing this is a user with the deleted field set to true and the card field set to null. Depending on the other options given, the patron's addresses, and other cards may also be deleted. This is probably not what you want.
Furthermore, I have evidence from our logs on Evergreen 3.0 that is somehow possible to do this from the web staff client:
2018-07-23 13:23:53 bd1-bh5 open-ils.cstore: [INFO:6883:
The result of the above was a patron set to deleted, the card field set to null, the patron's addresses deleted, and all the corresponding actor.card entries to active false.
A very simple fix would be to add a check at the top of the actor.usr_merge database function to bail if the src_user and dest_usr are the same. I have already tested such a fix on the above user and it works. I will post a branch shortly.
Changed in evergreen: | |
milestone: | none → 3.2-beta |
Changed in evergreen: | |
milestone: | 3.2-beta → 3.2-rc |
Changed in evergreen: | |
assignee: | nobody → Michele Morgan (mmorgan) |
Changed in evergreen: | |
importance: | Undecided → Medium |
status: | New → Won't Fix |
status: | Won't Fix → Confirmed |
assignee: | nobody → Galen Charlton (gmc) |
Changed in evergreen: | |
status: | Fix Committed → Fix Released |
Git branch that fixes it for me is here:
working/ user/dyrcona/ lp1786534- usr_merge- bail-on- same-user
http:// git.evergreen- ils.org/ ?p=working/ Evergreen. git;a=shortlog; h=refs/ heads/user/ dyrcona/ lp1786534- usr_merge- bail-on- same-user