Dear Evergreen Developers,  

While executing a patron purge initiative at Bibliomation, I encountered an issue related to shared addresses that prevented some deletions from completing. I was able to work around the issue, but I believe a more permanent fix should be implemented to prevent similar problems in the future.

I decided to share this as an email because it's a bit long and is easier to read with some shiny formatting that isn't possible on Launchpad. The root cause, as outlined in Bug #885270, is that cloned patrons historically shared the same address row in the database. When attempting to delete a patron whose address is still referenced by another user, the process fails. Over the years, multiple solutions have been introduced to mitigate this issue, but they remain somewhat fragmented and the bug ticket remains open.

Summary of Fixes Implemented So Far

  1. Library Setting: "Cloned patrons get address copy"

    • When enabled, this setting ensures newly cloned patrons receive a separate address entry rather than sharing the original.
    • However, this only prevents new instances of the issue and does not fix pre-existing shared addresses.
  2. fix_addresses.sql Script (shared by Jason Boyer)

    • This script untangles shared addresses by duplicating them, ensuring each patron has a unique address entry.
    • It serves as a one-time fix for existing shared addresses but does not enforce consistent behavior moving forward.
  3. Address Deletion Failure

    • The actor.usr_purge_data function currently attempts to delete all addresses linked to a user, which fails if the address is still referenced elsewhere.
    • A fail-safe could be added to prevent deletion if the address is still associated with another patron.

Proposed Next Steps

1. Make Cloning Behavior Consistent

2. Database Migration Fix

3. Modify actor.usr_purge_data to Handle Shared Addresses Gracefully

Next Steps & Feedback

Would the community support moving forward with this approach? If there’s consensus, I’d be happy to contribute toward implementing these updates.

Looking forward to your thoughts!

--
Best regards,

Ian Skelskey
Evergreen Systems Specialist
Bibliomation Inc.
203-577-4070 ext. 108