When lost items are not marked as returned, they are still subject to the long overdue cron, so an item that has already been marked Lost may automatically roll to Long Overdue. In some cases, a library may not want that lost value to change. This becomes especially important with the introduction of Claims Returned, which uses a variety of lost. I'd like to see two options added to the cron. The first to take a list of lost values that are subject to long overdue, the second to take a list of lost values that are not subject to long overdue.
Please keep in mind that there are also system preferences for the long overdue job, so we should use the same logic when adding new features!
Yes, absolutely! We've already got several options in the cron that can only be set at the command line. It would be good to move toward making those options all configurable from the staff client so those sysprefs are an accurate representation of the cron's behavior.
Created attachment 107461 [details] [review] Bug 25958: Allow LongOverdue cron to exclude specified lost values When lost items are not marked as returned, they are still subject to the long overdue cron, so an item that has already been marked Lost may automatically roll to Long Overdue. In some cases, a library may not want that lost value to change. This becomes especially important with the introduction of Claims Returned, which uses a variety of lost. Test Plan: 1) Set up a long overdue item that would be moved to lost by longoverdue.pl 2) Run the cronjob with the new --skip-lost-value option 3) Note the item is not altered 4) Include that value in the new system preference DefaultLongOverdueSkipLostStatuses 5) Run the cronjob *without* the new option 6) Note the item is not altered 7) Run the cronjob again with the new command line option, but set it to a different value so the item will be affected 8) Note the item is altered as it would have been before this patch was applied
Created attachment 107538 [details] [review] Bug 25958: Allow LongOverdue cron to exclude specified lost values When lost items are not marked as returned, they are still subject to the long overdue cron, so an item that has already been marked Lost may automatically roll to Long Overdue. In some cases, a library may not want that lost value to change. This becomes especially important with the introduction of Claims Returned, which uses a variety of lost. Test Plan: 1) Set up a long overdue item that would be moved to lost by longoverdue.pl 2) Run the cronjob with the new --skip-lost-value option 3) Note the item is not altered 4) Include that value in the new system preference DefaultLongOverdueSkipLostStatuses 5) Run the cronjob *without* the new option 6) Note the item is not altered 7) Run the cronjob again with the new command line option, but set it to a different value so the item will be affected 8) Note the item is altered as it would have been before this patch was applied Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Created attachment 108592 [details] [review] Bug 25958: Allow LongOverdue cron to exclude specified lost values When lost items are not marked as returned, they are still subject to the long overdue cron, so an item that has already been marked Lost may automatically roll to Long Overdue. In some cases, a library may not want that lost value to change. This becomes especially important with the introduction of Claims Returned, which uses a variety of lost. Test Plan: 1) Set up a long overdue item that would be moved to lost by longoverdue.pl 2) Run the cronjob with the new --skip-lost-value option 3) Note the item is not altered 4) Include that value in the new system preference DefaultLongOverdueSkipLostStatuses 5) Run the cronjob *without* the new option 6) Note the item is not altered 7) Run the cronjob again with the new command line option, but set it to a different value so the item will be affected 8) Note the item is altered as it would have been before this patch was applied Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com> Signed-off-by: Rebecca Coert <rcoert@arlingtonva.us>
Created attachment 108933 [details] [review] Bug 25958: Allow LongOverdue cron to exclude specified lost values When lost items are not marked as returned, they are still subject to the long overdue cron, so an item that has already been marked Lost may automatically roll to Long Overdue. In some cases, a library may not want that lost value to change. This becomes especially important with the introduction of Claims Returned, which uses a variety of lost. Test Plan: 1) Set up a long overdue item that would be moved to lost by longoverdue.pl 2) Run the cronjob with the new --skip-lost-value option 3) Note the item is not altered 4) Include that value in the new system preference DefaultLongOverdueSkipLostStatuses 5) Run the cronjob *without* the new option 6) Note the item is not altered 7) Run the cronjob again with the new command line option, but set it to a different value so the item will be affected 8) Note the item is altered as it would have been before this patch was applied Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com> Signed-off-by: Rebecca Coert <rcoert@arlingtonva.us> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 108934 [details] [review] Bug 25958: (QA follow-up) Add some punctuation to new DefaultLongOverdueSkipLostStatuses Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Kyle, why don't you build the SQL query to not retrieve items with itemlost in @skip_lost_values?
Created attachment 109028 [details] [review] Bug 25958: (QA follow-up) Implement filter in database query instead of in loop
Created attachment 109029 [details] [review] Bug 25958: (QA follow-up) Implement filter in database query instead of in loop
Pushed to master for 20.11, thanks to everybody involved!
backported to 20.05.x for 20.05.04
backported to 19.11.x for 19.11.10
Not backported to oldoldstable (19.05.x). Feel free to ask if it's needed.
Today while upgrading a Koha on stable from 20.05.04-1 to 20.05.03-1 I got: DBD::mysql::db do failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 [for Statement " INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('DefaultLongOverdueSkipLostStatuses', '', NULL, 'Skip these lost statuses by default in longoverdue.pl', 'Free'), "] at /usr/share/koha/intranet/cgi-bin/installer/data/mysql/updatedatabase.pl line 22388. Probably "fixed" running the query afterward: sudo koha-mysql $INSTANCE -e "INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('DefaultLongOverdueSkipLostStatuses', '', NULL, 'Skip these lost statuses by default in longoverdue.pl', 'Free');"
Created attachment 110635 [details] [review] Bug 25958 - Allow LongOverdue cron to exclude specified lost values [20.05.x] fix sql typo, https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25958#c15