Bug 18626 introduced the logging of changes to patron cardnumbers which is great, but this still does not link together previous cardnumbers. Imagine this scenario: A library patron loses their library card. They are issued with a replacement. Old and new cardnumbers are recorded in the Modification log. The old card is found (doesn't matter who finds it) and brought to the library. A member of library staff scan the barcode - get no results. This means they are none the wiser as to who this card belonged to. Would it not be a good idea to allow previous cardnumbers to be searchable? Some libraries may record this information somewhere in the patron record, but a search by cardnumber would be extremely helpful. It would be useful if the cardnumber moved into a linked field automatically when a new cardnumber was entered.
We really don't want them searchable or usable BUT do want staff to be able to see them without giving staff access to the modification logs. Mostly for troubleshooting the eResources where patrons used their old card to set up their accounts and now they have a new card that doesn't recognize them. Hoopla is our biggest issue.
Created attachment 193836 [details] [review] Bug 27364: Add historic_cardnumbers to Patron object & API This patch adds an historic_cardnumbers field to the patron object, staff client, and API call (which will return an array of objects containing information about the cardnumber and when it was changed). TO TEST: == APPLY PATCH == a) Ensure 'CardnumberLog' is on in the sysprefs b) Change the koha user's cardnumber from 42 to 67 c) Reverse step b) d) Go to the koha user's details page *) note how there is a historic cardnumbers box *) note how each change is marked, next to the date and time performed *) note how the time is accurate to minutes e) Go to /api/v1/patrons/51 *) notice how the historic_cardnumbers array is populated with two objects *) each object is per cardnumber change *) each object contains the new and old cardnumber, as well as the timestamp of the transaction == RESET_ALL == f) repeat steps d-e *) notice how the historic cardnumbers section is missing if no cardnumber change has occured, on the patron details page *) notice how the historic_cardnumbers array is empty in the api call, if no cardnumber change has occured == SIGN OFF ==