Like the "issues" field in the items table, there should be a field for "local_use" to keep the count of local uses. While this information is kept in the statistics table, it is a task to acquire, and if a library wants to keep bloat down on their tables, the statistics are pruned on a regular schedule, which means loss of valuable data. This counter would keep that valuable information in one field in each item record, rather than having a separate field for each instance in the statistics table. Unless it is vital to someone to know the exact moment a local use occurred, I am suggesting that this piece of information not be recorded in the statistics table any longer. This would significantly reduce the growth of the statistics table in general. Christopher
I think an option would be ok, but I am against removing it - the local use information in statistics will allow to look up the timeframe (local uses in the last x months, years...) which is useful information.
Perhaps a switch to turn the statistic on/off? But add the counter to the record.
Could work :)
I absolutely agree if would be handy to have a local use number in the record -- and then to show that number on moredetail.pl. But I also agree with Katrin that I don't see why we would remove those transactions from the statistics table.
Read the second paragraph. It addresses this question.
My feeling is that a simple counter loses meaning the longer you keep the data. What's better? 5 local uses in 10 years or 5 in one? With a simple counter, there is no way to tell. I think issues might give an indicator about 'use' of the book (when you might want to replace it), but not sure the local_use is interesting in the same way. That said, we could split the circulation log preference to not record. Is the size of the data in statistics really that much of an issue? I seem to remember that some libraries have kept their data without pruning ever and have to say we don't prune either and have some systems running for almost 10 years now. It's only used for statistics, so it doesn't slow anything down.
The bigger the system, the more data you have to sift through, and it can make reports very sluggish. I'd be fine if it were kept in the logs, if there were some mechanism that could prune the logs of items that are deleted, and the pruning could be fine tuned as needed.
I get a feeling that opinions on the stats tables vary wildly. As I said, I would not prune them, but only anonymize them if necessary. Having an idea about when something happened seems important to me. Having jobs with different options make sense. BTW: as far as I know it won't free space with MySQL if you delete lines. So that should not be a reason?
*** Bug 18668 has been marked as a duplicate of this bug. ***
Created attachment 149281 [details] [review] Bug 16122: Add localuse column to items and deleteditems
Created attachment 149282 [details] [review] Bug 16122: API and Schema updates
Created attachment 149283 [details] [review] Bug 16122: Increment items.localuse in AddReturn
Created attachment 149284 [details] [review] Bug 16122: Add display to holdings/otherholdings and Table settings
I've added some patches that will add an items.localuse column to the items table and also display this in the holdings/other holdings table. Leaving as assigned as this will still need adjusted/updated tests. Not sure how to deal with the information that is already available via statistics. I really think we should leave the statistics table as is. However we may need a script or DB update that will make the new items.localuse column congruent with what can be derived from statistics.
(In reply to Lucas Gass from comment #14) > I've added some patches that will add an items.localuse column to the items > table and also display this in the holdings/other holdings table. > > Leaving as assigned as this will still need adjusted/updated tests. > > Not sure how to deal with the information that is already available via > statistics. I really think we should leave the statistics table as is. > However we may need a script or DB update that will make the new > items.localuse column congruent with what can be derived from statistics. In my opinion, it would be good to have an option to convert those stats over to the new counters. It would also be good to have the option to clear out those stats from the statistics table once converted.
(In reply to Katrin Fischer from comment #8) > I get a feeling that opinions on the stats tables vary wildly. As I said, I > would not prune them, but only anonymize them if necessary. Having an idea > about when something happened seems important to me. Having jobs with > different options make sense. > > BTW: as far as I know it won't free space with MySQL if you delete lines. So > that should not be a reason? Hmmmm...this is news to me. I've always known data to take up space. Not sure how you can remove lines of data and not free up space. That is a huge problem if that is the case.
(In reply to Lucas Gass from comment #14) > I've added some patches that will add an items.localuse column to the items > table and also display this in the holdings/other holdings table. > > Leaving as assigned as this will still need adjusted/updated tests. > > Not sure how to deal with the information that is already available via > statistics. I really think we should leave the statistics table as is. > However we may need a script or DB update that will make the new > items.localuse column congruent with what can be derived from statistics. I should clarify, it would be good to at least capture the existing stats and convert them to the counters before those stats are eliminated through table clean up.
(In reply to Christopher Brannon from comment #17) > (In reply to Lucas Gass from comment #14) > > I've added some patches that will add an items.localuse column to the items > > table and also display this in the holdings/other holdings table. > > > > Leaving as assigned as this will still need adjusted/updated tests. > > > > Not sure how to deal with the information that is already available via > > statistics. I really think we should leave the statistics table as is. > > However we may need a script or DB update that will make the new > > items.localuse column congruent with what can be derived from statistics. > > I should clarify, it would be good to at least capture the existing stats > and convert them to the counters before those stats are eliminated through > table clean up. https://stackoverflow.com/questions/1270944/mysql-innodb-not-releasing-disk-space-after-deleting-data-rows-from-table
(In reply to Katrin Fischer from comment #18) > (In reply to Christopher Brannon from comment #17) > > (In reply to Lucas Gass from comment #14) > > > I've added some patches that will add an items.localuse column to the items > > > table and also display this in the holdings/other holdings table. > > > > > > Leaving as assigned as this will still need adjusted/updated tests. > > > > > > Not sure how to deal with the information that is already available via > > > statistics. I really think we should leave the statistics table as is. > > > However we may need a script or DB update that will make the new > > > items.localuse column congruent with what can be derived from statistics. > > > > I should clarify, it would be good to at least capture the existing stats > > and convert them to the counters before those stats are eliminated through > > table clean up. > > https://stackoverflow.com/questions/1270944/mysql-innodb-not-releasing-disk- > space-after-deleting-data-rows-from-table Well, that is just insane. REGARDLESS, I know for a fact that table queries on smaller tables run faster. Tables must be pruned on a regular basis to maintain optimal performance. This bug will ensure needed data is maintained over time.
Created attachment 150231 [details] [review] Bug 16122: Increment localuse when checking out to stats patron
TEST PLAN: To test: 1. Apply patch, updatedatabase & schema, restart all Services 2. Go to Administration > Table setting. Find the holdings table ( Catalog > holdings_table ) and turn the local use column on. 3. Go to an item record and notice the column 'Local uses' 4. Turn the system preference RecordLocalUseOnReturn Off. 5. Check in an item that is not checkout out. No local use should be recorded for the item. 6. Turn RecordLocalUseOnReturn on and check in an item that is not checked out. Local use on that item should increment by 1. 7. Create a statistical patron and check an item out to them. Local use should increment by 1. 8. Go to /api/v1/items?external_id={barcode} and make sure the numbers for localuse look correct.
Created attachment 150232 [details] [review] Bug 16122: Add localuse column to items and deleteditems Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Created attachment 150233 [details] [review] Bug 16122: API and Schema updates Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Created attachment 150234 [details] [review] Bug 16122: Increment items.localuse in AddReturn Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Created attachment 150235 [details] [review] Bug 16122: Add display to holdings/otherholdings and Table settings Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Created attachment 150236 [details] [review] Bug 16122: Increment localuse when checking out to stats patron Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Works like a charm! Cool beans!
FYI, I filed bug 32440 suggesting cleanup_database get enhanced to allow selective deletion from statistics based on type. Right now (per bug 19008) cleanup_database can delete all statistics entries older than a specified interval, but it makes sense to me to allow an additional constraint based on statistics.type.
Christopher, Thanks for you sign-off! I do need to reset this one to ASSIGNED as it still needs some work. -Unit tests -Need to figure out what to do about the existing data in the stats table
Created attachment 150623 [details] [review] Bug 16122: Add maintenance script to update items.localuse from stats
Created attachment 150693 [details] [review] Bug 16122: Add maintenance script to update items.localuse from stats
Lucas, can you provide a test plan for that last patch? If so I'd be happy to sign off.
Tried to test this, but the patch does not apply. Applying: Bug 16122: Add localuse column to items and deleteditems Applying: Bug 16122: API and Schema updates Applying: Bug 16122: Increment items.localuse in AddReturn Applying: Bug 16122: Add display to holdings/otherholdings and Table settings Using index info to reconstruct a base tree... M admin/columns_settings.yml M koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt Auto-merging admin/columns_settings.yml Applying: Bug 16122: Increment localuse when checking out to stats patron error: sha1 information is lacking or useless (C4/Circulation.pm). error: could not build fake ancestor Patch failed at 0001 Bug 16122: Increment localuse when checking out to stats patron
(In reply to Emily Lamancusa from comment #33) > Tried to test this, but the patch does not apply. > > Applying: Bug 16122: Add localuse column to items and deleteditems > Applying: Bug 16122: API and Schema updates > Applying: Bug 16122: Increment items.localuse in AddReturn > Applying: Bug 16122: Add display to holdings/otherholdings and Table settings > Using index info to reconstruct a base tree... > M admin/columns_settings.yml > M koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt > Falling back to patching base and 3-way merge... > Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt > Auto-merging admin/columns_settings.yml > Applying: Bug 16122: Increment localuse when checking out to stats patron > error: sha1 information is lacking or useless (C4/Circulation.pm). > error: could not build fake ancestor > Patch failed at 0001 Bug 16122: Increment localuse when checking out to > stats patron This still applies cleanly for me.
(In reply to Emily Lamancusa from comment #32) > Lucas, can you provide a test plan for that last patch? If so I'd be happy > to sign off. To test: 1. Without the patch, have RecordLocalUseOnReturn on. 2. Check in some items to record localuse in the stats table. Keep note of those stats. 3. Apply the patches, updatedatabase. 4. Run the maintenance script, perl update_localuse_from_statistics.pl 5. Now check that items.localuse is congruent with what is in the stats table Using this report can help: SELECT COUNT( IF( statistics.type = 'localuse', statistics.itemnumber, NULL ) ) AS 'local use count' FROM statistics WHERE statistics.itemnumber=<<itemnumber>>
Hmmm, I'm still getting the error when I try to apply it.
Hi Lucas, I am having the same issue as Emily on current master: Applying: Bug 16122: Add display to holdings/otherholdings and Table settings Using index info to reconstruct a base tree... M admin/columns_settings.yml M koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt Auto-merging admin/columns_settings.yml Applying: Bug 16122: Increment localuse when checking out to stats patron error: sha1 information is lacking or useless (C4/Circulation.pm). error: could not build fake ancestor Patch failed at 0001 Bug 16122: Increment localuse when checking out to stats patron hint: Use 'git am --show-current-patch=diff' to see the failed patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-16122-Increment-localuse-when-checking-out-to--o5eeizs8.patch We might be missing something that is in your repository.
Created attachment 153193 [details] [review] Bug 16122: Add display and increment localuse
rebased for current master
Created attachment 153196 [details] [review] Bug 16122: Add localuse column to items and deleteditems Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Created attachment 153197 [details] [review] Bug 16122: API and Schema updates Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Created attachment 153198 [details] [review] Bug 16122: Increment items.localuse in AddReturn Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Created attachment 153199 [details] [review] Bug 16122: Add maintenance script to update items.localuse from stats Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Created attachment 153200 [details] [review] Bug 16122: Add display and increment localuse Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
+1 for items.localuse counter field from Ocean State Libraries.
+1
This still applies cleanly, what would it take to get some QA eyes on it?
(In reply to Lucas Gass from comment #47) > This still applies cleanly, what would it take to get some QA eyes on it? Stop commenting so it goes down in the list - I have been working on bugs first and oldest next ;)
(In reply to Katrin Fischer from comment #48) > (In reply to Lucas Gass from comment #47) > > This still applies cleanly, what would it take to get some QA eyes on it? > > Stop commenting so it goes down in the list - I have been working on bugs > first and oldest next ;) Ha. fair enough! :)
Created attachment 158466 [details] [review] Bug 16122: Add localuse column to items and deleteditems Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 158467 [details] [review] Bug 16122: API and Schema updates Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 158468 [details] [review] Bug 16122: Increment items.localuse in AddReturn Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 158469 [details] [review] Bug 16122: Add maintenance script to update items.localuse from stats Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 158470 [details] [review] Bug 16122: Add display and increment localuse Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 158471 [details] [review] Bug 16122: (QA follow-up) Perltidy, fix spelling and db comments * COMMENT in database update and kohastructure didn't match up * Fix some localuse to local use in text/descriptions * Perltidy Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
**ATTENTION** We might want to push the bugfix from bug 27992 first, although it might create a small conflict in Circulation.pm here. 1) QA test script Still applies, but requires perltidy: WARN C4/Circulation.pm WARN tidiness The file is less tidy than before (bad/messy lines before: 1104, now: 1108) WARN installer/data/mysql/atomicupdate/bug_16122_atomicupdate.pl WARN tidiness The file is less tidy than before (bad/messy lines before: 0, now: 10) WARN misc/maintenance/update_localuse_from_statistics.pl WARN tidiness The file is less tidy than before (bad/messy lines before: 0, now: 8) Fixed in a follow-up. Also fixed: * COMMENT in database update and kohastructure didn't match up * some spelling 2) We need unit tests. (blocker) 3) Column configuration page for items table on detail page needs to be updated. Suggestion: I'd hide this column by default for existing and new installations to not grow the items table. 4) Maintenance script +use strict; +use warnings; Should be: use Modern::Perl; It feels like this should have a verbose option and maybe a warning/hint that existing entries in items will be overwritten?
Will still need to test some more once we have the tests.
Created attachment 161001 [details] [review] Bug 16122: Add localuse column to items and deleteditems Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 161002 [details] [review] Bug 16122: API and Schema updates Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 161003 [details] [review] Bug 16122: Increment items.localuse in AddReturn
Created attachment 161004 [details] [review] Bug 16122: Add display and Table settings
Created attachment 161005 [details] [review] Bug 16122: Add maintenance script to update items.localuse from stats Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 161006 [details] [review] Bug 16122: Perltidy and spelling To test: 1. Apply patch, updatedatabase & schema, restart all Services 2. Go to Administration > Table setting. Find the holdings table ( Catalog > holdings_table ) and turn the local use column on. 3. Go to an item record and notice the column 'Local uses' 4. Turn the system preference RecordLocalUseOnReturn Off. 5. Check in an item that is not checkout out. No local use should be recorded for the item. 6. Turn RecordLocalUseOnReturn on and check in an item that is not checked out. Local use on that item should increment by 1. 7. Create a statistical patron and check an item out to them. Local use should increment by 1. 8. Go to /api/v1/items?external_id={barcode} and make sure the numbers for localuse look correct. To test maintainence script: 1. Without the patch, have RecordLocalUseOnReturn on. 2. Check in some items to record localuse in the stats table. Keep note of those stats. 3. Apply the patches, updatedatabase. 4. Run the maintenance script, perl update_localuse_from_statistics.pl 5. Now check that items.localuse is congruent with what is in the stats table
Created attachment 161144 [details] [review] Bug 16122: Add localuse column to items and deleteditems Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 161145 [details] [review] Bug 16122: API and Schema updates Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 161146 [details] [review] Bug 16122: Increment items.localuse in AddReturn
Created attachment 161147 [details] [review] Bug 16122: Add display and Table settings
Created attachment 161148 [details] [review] Bug 16122: Add maintenance script to update items.localuse from stats Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 161149 [details] [review] Bug 16122: Perltidy and spelling To test: 1. Apply patch, updatedatabase & schema, restart all Services 2. Go to Administration > Table setting. Find the holdings table ( Catalog > holdings_table ) and turn the local use column on. 3. Go to an item record and notice the column 'Local uses' 4. Turn the system preference RecordLocalUseOnReturn Off. 5. Check in an item that is not checkout out. No local use should be recorded for the item. 6. Turn RecordLocalUseOnReturn on and check in an item that is not checked out. Local use on that item should increment by 1. 7. Create a statistical patron and check an item out to them. Local use should increment by 1. 8. Go to /api/v1/items?external_id={barcode} and make sure the numbers for localuse look correct. To test maintainence script: 1. Without the patch, have RecordLocalUseOnReturn on. 2. Check in some items to record localuse in the stats table. Keep note of those stats. 3. Apply the patches, updatedatabase. 4. Run the maintenance script, perl update_localuse_from_statistics.pl 5. Now check that items.localuse is congruent with what is in the stats table
Created attachment 161150 [details] [review] Bug 16122: AddReturn unit tests and small fix in sub AddReturn
Created attachment 161151 [details] [review] Bug 16122: CanBookBeIssued unit test
When I have RecordLocalUseOnCheckin enabled and check an item out to a statistical patron, Local Use for that item goes up by 2. That seems wrong, but also doesn't appear to be new, exactly. Without this patch, if I have RecordLocalUseOnCheckin enabled and check an item out to a statistical patron I get 2 local use lines in statistics. I'm going to file a new bug for this issue, I only mention it here because I almost marked this one Failed QA thinking it was new behavior rather than old behavior made more obvious.
Created attachment 161153 [details] [review] Bug 16122: Add localuse column to items and deleteditems Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Created attachment 161154 [details] [review] Bug 16122: API and Schema updates Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Created attachment 161155 [details] [review] Bug 16122: Increment items.localuse in AddReturn Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Created attachment 161156 [details] [review] Bug 16122: Add display and Table settings Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Created attachment 161157 [details] [review] Bug 16122: Add maintenance script to update items.localuse from stats Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Created attachment 161158 [details] [review] Bug 16122: Perltidy and spelling To test: 1. Apply patch, updatedatabase & schema, restart all Services 2. Go to Administration > Table setting. Find the holdings table ( Catalog > holdings_table ) and turn the local use column on. 3. Go to an item record and notice the column 'Local uses' 4. Turn the system preference RecordLocalUseOnReturn Off. 5. Check in an item that is not checkout out. No local use should be recorded for the item. 6. Turn RecordLocalUseOnReturn on and check in an item that is not checked out. Local use on that item should increment by 1. 7. Create a statistical patron and check an item out to them. Local use should increment by 1. 8. Go to /api/v1/items?external_id={barcode} and make sure the numbers for localuse look correct. To test maintainence script: 1. Without the patch, have RecordLocalUseOnReturn on. 2. Check in some items to record localuse in the stats table. Keep note of those stats. 3. Apply the patches, updatedatabase. 4. Run the maintenance script, perl update_localuse_from_statistics.pl 5. Now check that items.localuse is congruent with what is in the stats table Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Created attachment 161159 [details] [review] Bug 16122: AddReturn unit tests and small fix in sub AddReturn Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Created attachment 161160 [details] [review] Bug 16122: CanBookBeIssued unit test Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
(In reply to Andrew Fuerste-Henry from comment #72) > When I have RecordLocalUseOnCheckin enabled and check an item out to a > statistical patron, Local Use for that item goes up by 2. That seems wrong, > but also doesn't appear to be new, exactly. Without this patch, if I have > RecordLocalUseOnCheckin enabled and check an item out to a statistical > patron I get 2 local use lines in statistics. I'm going to file a new bug > for this issue, I only mention it here because I almost marked this one > Failed QA thinking it was new behavior rather than old behavior made more > obvious. Thanks Andrew! I have added a patch to Bug 35840 in an attempt to fix this issue.
This needs to be BLOCKED until Bug 35840 moves.
Needs rebased/refactored on top of Bug 35950.
Created attachment 163072 [details] [review] Bug 16122: Add localuse column to items and deleteditems Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Created attachment 163073 [details] [review] Bug 16122: API and Schema updates Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Created attachment 163074 [details] [review] Bug 16122: Increment items.localuse
Created attachment 163075 [details] [review] Bug 16122: Add display and Table settings Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Created attachment 163076 [details] [review] Bug 16122: Add maintenance script to update items.localuse from stats Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Created attachment 163077 [details] [review] Bug 16122: Add unit test To test: 1. Apply patch, updatedatabase & schema, restart all Services 2. Go to Administration > Table setting. Find the holdings table ( Catalog > holdings_table ) and turn the local use column on. 3. Go to an item record and notice the column 'Local uses' 4. Turn the system preference RecordLocalUseOnReturn Off. 5. Check in an item that is not checkout out. No local use should be recorded for the item. 6. Turn RecordLocalUseOnReturn on and check in an item that is not checked out. Local use on that item should increment by 1. 7. Create a statistical patron and check an item out to them. Local use should increment by 1. 8. Go to /api/v1/items?external_id={barcode} and make sure the numbers for localuse look correct. To test maintainence script: 1. Without the patch, have RecordLocalUseOnReturn on. 2. Check in some items to record localuse in the stats table. Keep note of those stats. 3. Apply the patches, updatedatabase. 4. Run the maintenance script, perl update_localuse_from_statistics.pl 5. Now check that items.localuse is congruent with what is in the stats table
Created attachment 163243 [details] [review] Bug 16122: Add localuse column to items and deleteditems Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Created attachment 163244 [details] [review] Bug 16122: API and Schema updates Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Created attachment 163245 [details] [review] Bug 16122: Increment items.localuse Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Created attachment 163246 [details] [review] Bug 16122: Add display and Table settings Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Created attachment 163247 [details] [review] Bug 16122: Add maintenance script to update items.localuse from stats Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Created attachment 163248 [details] [review] Bug 16122: Add unit test To test: 1. Apply patch, updatedatabase & schema, restart all Services 2. Go to Administration > Table setting. Find the holdings table ( Catalog > holdings_table ) and turn the local use column on. 3. Go to an item record and notice the column 'Local uses' 4. Turn the system preference RecordLocalUseOnReturn Off. 5. Check in an item that is not checkout out. No local use should be recorded for the item. 6. Turn RecordLocalUseOnReturn on and check in an item that is not checked out. Local use on that item should increment by 1. 7. Create a statistical patron and check an item out to them. Local use should increment by 1. 8. Go to /api/v1/items?external_id={barcode} and make sure the numbers for localuse look correct. To test maintainence script: 1. Without the patch, have RecordLocalUseOnReturn on. 2. Check in some items to record localuse in the stats table. Keep note of those stats. 3. Apply the patches, updatedatabase. 4. Run the maintenance script, perl update_localuse_from_statistics.pl 5. Now check that items.localuse is congruent with what is in the stats table Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Created attachment 163296 [details] [review] Bug 16122: Add localuse column to items and deleteditems Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 163297 [details] [review] Bug 16122: API and Schema updates Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 163298 [details] [review] Bug 16122: Increment items.localuse Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 163299 [details] [review] Bug 16122: Add display and Table settings Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 163300 [details] [review] Bug 16122: Add maintenance script to update items.localuse from stats Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 163301 [details] [review] Bug 16122: Add unit test To test: 1. Apply patch, updatedatabase & schema, restart all Services 2. Go to Administration > Table setting. Find the holdings table ( Catalog > holdings_table ) and turn the local use column on. 3. Go to an item record and notice the column 'Local uses' 4. Turn the system preference RecordLocalUseOnReturn Off. 5. Check in an item that is not checkout out. No local use should be recorded for the item. 6. Turn RecordLocalUseOnReturn on and check in an item that is not checked out. Local use on that item should increment by 1. 7. Create a statistical patron and check an item out to them. Local use should increment by 1. 8. Go to /api/v1/items?external_id={barcode} and make sure the numbers for localuse look correct. To test maintainence script: 1. Without the patch, have RecordLocalUseOnReturn on. 2. Check in some items to record localuse in the stats table. Keep note of those stats. 3. Apply the patches, updatedatabase. 4. Run the maintenance script, perl update_localuse_from_statistics.pl 5. Now check that items.localuse is congruent with what is in the stats table Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 163302 [details] [review] Bug 16122: Tidy changed code blocks Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 163303 [details] [review] Bug 16122: Add note to database update to point out new script Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
All works as designed, QA scripts are happy, tests are passing and new coverage is added. Passing QA, well perserverred Lucas!
I am sorry, but the detail page requires some more work due to: Bug 33568 - Use the REST API to display items on the biblio detail view Please rebase and push back into my queue.
Created attachment 165313 [details] [review] Bug 16122: Add localuse column to items and deleteditems Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 165314 [details] [review] Bug 16122: API and Schema updates Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 165315 [details] [review] Bug 16122: Increment items.localuse Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 165316 [details] [review] Bug 16122: Add display and Table settings Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 165317 [details] [review] Bug 16122: Add maintenance script to update items.localuse from stats Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 165318 [details] [review] Bug 16122: Add unit test To test: 1. Apply patch, updatedatabase & schema, restart all Services 2. Go to Administration > Table setting. Find the holdings table ( Catalog > holdings_table ) and turn the local use column on. 3. Go to an item record and notice the column 'Local uses' 4. Turn the system preference RecordLocalUseOnReturn Off. 5. Check in an item that is not checkout out. No local use should be recorded for the item. 6. Turn RecordLocalUseOnReturn on and check in an item that is not checked out. Local use on that item should increment by 1. 7. Create a statistical patron and check an item out to them. Local use should increment by 1. 8. Go to /api/v1/items?external_id={barcode} and make sure the numbers for localuse look correct. To test maintainence script: 1. Without the patch, have RecordLocalUseOnReturn on. 2. Check in some items to record localuse in the stats table. Keep note of those stats. 3. Apply the patches, updatedatabase. 4. Run the maintenance script, perl update_localuse_from_statistics.pl 5. Now check that items.localuse is congruent with what is in the stats table Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 165319 [details] [review] Bug 16122: Tidy changed code blocks Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 165320 [details] [review] Bug 16122: Add note to database update to point out new script Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
rebased for current main and back to PQA.
Hm, DBIC changes here are mixed in with other changes, so I have kept the patch. dbic comes up empty. I have been told it would be better to regenerate usually so timestamps etc. match
I am a fan of scripts that update data having a --confirm switch, this one just has the -h. I know that you should always run the latter first, so leaving this more as a note and suggestion.
Pushed for 24.05! Well done everyone, thank you!
(In reply to Katrin Fischer from comment #115) > Hm, DBIC changes here are mixed in with other changes, so I have kept the > patch. dbic comes up empty. I have been told it would be better to > regenerate usually so timestamps etc. match I just figured out what happens when you don't run dbic again - it causes issues! - please only strictly separate patches in future! :)
(In reply to Katrin Fischer from comment #116) > I am a fan of scripts that update data having a --confirm switch, this one > just has the -h. I know that you should always run the latter first, so > leaving this more as a note and suggestion. I will add a confirm flag: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36709
(In reply to Katrin Fischer from comment #118) > (In reply to Katrin Fischer from comment #115) > > Hm, DBIC changes here are mixed in with other changes, so I have kept the > > patch. dbic comes up empty. I have been told it would be better to > > regenerate usually so timestamps etc. match > > I just figured out what happens when you don't run dbic again - it causes > issues! - please only strictly separate patches in future! :) Noted. Thanks!
Not backported to 23.11.x