Bug 13542 - Subscription is the only table to store userid instead of borrowernumber
Summary: Subscription is the only table to store userid instead of borrowernumber
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Database (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Galen Charlton
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-09 09:15 UTC by Katrin Fischer
Modified: 2023-07-28 21:04 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2015-01-09 09:15:53 UTC
When a new subscription is created in the serials module, the userid of the staff member is saved to subscripiton.librarian. 

This makes subscription the only table to store information about the patron not using the borrowernumber, but the userid instead.

If you delete the staff member, his/her userid will stay in the subscription forever.
Comment 1 Katrin Fischer 2015-01-09 09:16:57 UTC
Also, if the userid changes, the information in the subscription table might get useless.
Comment 2 Jonathan Druart 2016-01-13 14:54:34 UTC
Can we envisage to simply remove this column?
Comment 3 Katrin Fischer 2016-01-13 14:58:25 UTC
We save the creator in lots of places, maybe we could replaces it with a creator/user... whatever that has a FK on borrowers with a SET NULL on deletion of the borrower? 

We could also look up the userid visible in the borrowers and deletedborrowers tables ... but that might not always lead to a correct borrowernumber (userid could have been reused... not sure if that happens often).

A bit worried a library might complain, but at the same time I am not sure how useful it is to save the initial creator - if someone changes the subscription afer, noone will know.
Comment 4 Jonathan Druart 2018-07-25 15:24:22 UTC
It is actually worst than that, it is using "loggedinusername" that is a concatenation of firstname and surname of the logged in librarian.

This value is never displayed or reused anywhere else.
Comment 5 Jonathan Druart 2018-07-25 15:35:44 UTC
(In reply to Jonathan Druart from comment #4)
> It is actually worst than that, it is using "loggedinusername" that is a
> concatenation of firstname and surname of the logged in librarian.
> 
> This value is never displayed or reused anywhere else.

This is wrong, it's the userid!
Comment 6 Katrin Fischer 2023-07-28 21:04:14 UTC
Could we try to replace userid with borrowernumber by lookup in borrowers and deletedborrowers?