https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23010

--- Comment #39 from Lucas Gass (lukeg) <[email protected]> ---

> - The Automatic Item Modification by Age tool is able to set the withdrawn
> status, so it needs to handle the exception. Currently, with the patchset,
> the cron crashes if it tries to set the withdrawn status on an item where
> withdrawing is not allowed.
> Example steps to produce the error:
> 1. Set PreventWithdrawingItemsStatus to prevent withdrawing on both checkout
> and in-transit
> 2. Add the following Automatic Item Modification by Age rule:
>     age: 365
>     age field: items.dateaccessioned
>     condition: items.biblionumber = 126
>     substitution: items.withdrawn = 1
> **Note, due to bug 39864, you currently cannot do this through the staff
> interface, and you need to insert the rule directly into the database:
> INSERT INTO systempreferences(variable, value) VALUES
> ('automatic_item_modification_by_age_configuration',
> '[{"agefield":"items.dateaccessioned","conditions":[{"value":126,"field":
> "items.biblionumber"}],"age":"400","substitutions":[{"field":"items.
> withdrawn","value":"1"}]}]');
> 
> 3. Search for biblionumber 126 (Intermediate Perl)
> 4. Check out one of its items and put another one of its items in-transit
> 5. misc/cronjobs/automatic_item_modification_by_age.pl -v 
> --> Confirm the cron will try to withdraw the 4 items from that bib
> 6. misc/cronjobs/automatic_item_modification_by_age.pl -c
> --> Cron job throws an exception

Great catch here, I've corrected it with a follow up patch.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to