https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44039
--- Comment #1 from Adolfo RodrÃguez Taboada <[email protected]> --- Created attachment 211098 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211098&action=edit Bug 44039: Do not allow merging the logged in user's patron account into another patron The patron merge (members/merge-patrons.pl) does not check whether the logged in user is among the patrons to be merged into the one being kept. If they are, the merge goes ahead and deletes the account of the logged in user: their session is left without a patron, and the next request fails with an error 500 (Can't call method "libraries_where_can_see_patrons" on an undefined value). This patch stops the merge with an error message when the logged in user is one of the patrons that would be deleted, as members/deletemem.pl already does when deleting a patron (CANT_DELETE_YOURSELF). Keeping the logged in user and merging other patrons into it still works. Steps to follow: 1. Create a staff patron with the permission to merge patrons (or a superlibrarian), for example "mergetest", and another patron, for example "mergekeep". 2. Log in to the staff interface as mergetest (a private window is handy). 3. Patrons: search for both patrons, select them and click "Merge selected patrons". 4. Choose mergekeep as the patron to keep and click "Merge patrons". 5. The merge is done and mergetest is deleted. Click any link: there is an error 500. 6. Log in with your usual user and create mergetest again, as in step 1. 7. Apply the patch. 8. Repeat steps 2 to 4: the merge is not done and there is the message "Merge failed! Your own patron account cannot be merged into another patron, as it would be deleted." Both patrons still exist and you are still logged in. 9. Repeat steps 3 and 4, but choose mergetest as the patron to keep: the merge is done and mergekeep is merged into mergetest. Co-Authored-By: Claude Opus 5.5 <[email protected]> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list -- [email protected] To unsubscribe send an email to [email protected] website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
