Description
Nick Clemens (kidclamp)
2016-08-26 13:11:11 UTC
Indeed, there are no foreign keys in collections_tracking table. (In reply to Fridolin SOMERS from comment #1) > Indeed, there are no foreign keys in collections_tracking table. I will add it as a part of bug 18606 I've found a problematic side-effect of this I think: - someone deletes a rotating collection without removing the items on that collection first - The itemnumbers remain in the collections_tracking table - Those items on that deleted collection no longer are subject to usual transfers - if you return an item it no longer gives the popup message to transfer the item to its home library until the rows are removed in the database. Looks like items that have been left behind in collections_tracking after their collection has been deleted are also blocked from being added to a new collection. Confirmed this is still true in master. Created attachment 119306 [details] [review] Bug 17202: Don't report an item in a collection if the collection doesn't exist This simply adds a JOIN to the collections table - if the collection is gone then the item is not considered to be in a rotating collection Also remove variable to store the return that is not used later To test: Create a rotating collection Add an item Delete the rotating collection View the db (SELECT * FROM collections_tracking;) The item is still in the collection Enable AutomaticItemReturn Checkin the item at a branch not its home The item does not get transferred home Apply patch Restart all the things Check in the item, it is transferred home Created attachment 119330 [details] [review] Bug 17202: Don't report an item in a collection if the collection doesn't exist This simply adds a JOIN to the collections table - if the collection is gone then the item is not considered to be in a rotating collection Also remove variable to store the return that is not used later To test: Create a rotating collection Add an item Delete the rotating collection View the db (SELECT * FROM collections_tracking;) The item is still in the collection Enable AutomaticItemReturn Checkin the item at a branch not its home The item does not get transferred home Apply patch Restart all the things Check in the item, it is transferred home Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 120099 [details] [review] Bug 17202: Don't report an item in a collection if the collection doesn't exist This simply adds a JOIN to the collections table - if the collection is gone then the item is not considered to be in a rotating collection Also remove variable to store the return that is not used later To test: Create a rotating collection Add an item Delete the rotating collection View the db (SELECT * FROM collections_tracking;) The item is still in the collection Enable AutomaticItemReturn Checkin the item at a branch not its home The item does not get transferred home Apply patch Restart all the things Check in the item, it is transferred home Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 120100 [details] [review] Bug 17202: (QA follow-up) Add foreign key constraint Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Missing test coverage. Created attachment 120216 [details] [review] Bug 17202: Unit tests Created attachment 120217 [details] [review] Bug 17202: Don't report an item in a collection if the collection doesn't exist This simply adds a JOIN to the collections table - if the collection is gone then the item is not considered to be in a rotating collection Also remove variable to store the return that is not used later To test: Create a rotating collection Add an item Delete the rotating collection View the db (SELECT * FROM collections_tracking;) The item is still in the collection Enable AutomaticItemReturn Checkin the item at a branch not its home The item does not get transferred home Apply patch Restart all the things Check in the item, it is transferred home Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 120218 [details] [review] Bug 17202: (QA follow-up) Add foreign key constraint Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 120219 [details] [review] Bug 17202: (follow-up) Conditionally add FK Pushed to master for 21.05, thanks to everybody involved! Does not apply in 20.11.x, please provide rebase if needed. |