Summary: | Longoverdue cronjob gives error when run with "--library" flag and CircControl syspref set to "The library you are logged in at" | ||
---|---|---|---|
Product: | Koha | Reporter: | Andrew Fuerste-Henry <andrew> |
Component: | Command-line Utilities | Assignee: | Andrew Fuerste-Henry <andrew> |
Status: | Failed QA --- | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | normal | ||
Priority: | P5 - low | CC: | jake.deery, lucas, m.de.rooy, martin.renvoize, nick, robin |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Bug Depends on: | 9596, 38894 | ||
Bug Blocks: | |||
Attachments: |
Bug 38893: Quit job with message when longoverdue run with --library and CircControl set to logged in library
Bug 38893: Quit job with message when longoverdue run with --library and CircControl set to logged in library |
Description
Andrew Fuerste-Henry
2025-01-14 19:17:50 UTC
Created attachment 176535 [details] [review] Bug 38893: Quit job with message when longoverdue run with --library and CircControl set to logged in library To test: 1: Set CircControl to "the item's library" and run longoverdue with the --library flag, it works 2: Set CircControl to "the library you are logged in at" and run longoverdue, it gives an error 3: Apply patch, restart all 4: run longoverdue, it quits and tells you "Use of --library flag not permitted when the CircControl system preference set to 'the library you are logged in at'" Possible there's a better solution here, but this is an improvement. I'm afraid I'm gonna need a more descriptive test plan. When checked out on main, I get this when running the script: kohadev-koha@kohadevbox:koha(main)$ ./misc/cronjobs/longoverdue.pl --confirm --library Option library requires an argument Weirdly, I get this if I flip the flags around: kohadev-koha@kohadevbox:koha(main)$ ./misc/cronjobs/longoverdue.pl --library --confirm ### TEST MODE -- NO ACTIONS TAKEN ### The library --confirm does not exist in the database Worth noting, this happens with `CircControl` set any which way. ... the script does seem wonky, but I can't add my sign-off line without reproducing the issue. Sorry Andrew, could you provide more information for me? Jake. Created attachment 176889 [details] [review] Bug 38893: Quit job with message when longoverdue run with --library and CircControl set to logged in library To test: 1: Set CircControl to "the item's library" and run longoverdue with the --library flag, it works 2: Set CircControl to "the library you are logged in at" and run longoverdue, it gives an error 3: Apply patch, restart all 4: Run longoverdue, it quits and tells you "Use of --library flag not permitted when the CircControl system preference set to 'the library you are logged in at'" Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> I think this makes sense.. did wonder if we aught to just set $lib to the current library the loop is acting on.. i.e whatever was passed to the --library option of the script.. CircControl is a bit of a nonsense in this configuration here though I agree. Not sure why we just test this sofar in the script. Feels like we should test it much earlier and bail out. (In reply to Marcel de Rooy from comment #6) > Not sure why we just test this sofar in the script. Feels like we should > test it much earlier and bail out. Yes, good idea. I think we can just test if CircControl is set to the logged in library option and if a branch/library flag is passed. In which case, we bail. :) |