https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39962 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pedro.amorim@openfifth.co.u | |k Status|Passed QA |Failed QA --- Comment #15 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Hi all, this is not yet ready for push. Picking up on Marcel's question from comment 6: the bug describes a display problem in the holdings table, but the patches also change circulation logic and add a database update. Marcel's points there were never answered, and they're where the problems are: 1) Which loan gets recalled has changed. When a record-level recall is placed, Koha picks a checked out item to recall and shortens that loan. To decide which items can be recalled, Koha::Recall->checkout checks 'recalls_allowed'. It used to use the logged in library's rule, the patches change it to the pickup library's rule. If those rules differ, a different patron's loan gets shortened. This isn't mentioned in the commit messages, and it seems to be there only so the atomicupdate doesn't crash (there's no logged in library during updatedatabase). To reproduce: 1) Apply the patches, updatedatabase, restart_all 2) Set 'UseRecalls' to 'can be placed through both the OPAC and staff interface' 3) In http://localhost:8081/cgi-bin/koha/admin/smart-rules.pl, on the 'All libraries' / 'All' / 'All' rule, set 'Recalls allowed (total)' 5, 'Recalls per record (count)' 5, 'On shelf recalls allowed' 'If any unavailable', 'Recall due date interval (day)' 3 4) Select 'Fairview', add a rule for 'All' categories / 'Books' with 'Recalls allowed (total)' 0 5) Edit item 39999000000795 of 'Robert Burns' (http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=18) and set its item type to 'Music' 6) Check out 39999000000771 (Books) to Sonia Frazier, due in 10 days 7) Check out 39999000000795 (Music) to Johnny Bryan, due in 20 days 8) Log into the OPAC as 'koha', go to http://localhost:8080/cgi-bin/koha/opac-recall.pl?biblionumber=18, pick 'Fairview' as pickup library and place the recall 9) Check both patrons' due dates: Johnny's loan has been shortened, Sonia's is unchanged. Without the patches it's the other way around, Sonia's (the one due soonest) gets shortened. 2) The atomicupdate uses Koha objects (Koha::Recalls, $recall->checkout) instead of plain SQL, as Marcel pointed out: https://wiki.koha-community.org/wiki/Database_updates#DBIx::Class. That's what led to 1). 3) Marcel also asked for tests, there are still none for the changes in Koha::Recalls->add_recall and Koha::Item->recall. Minor, but one would have caught that Koha::Item->recall now compares '$recall->item_id == $self->itemnumber' for record-level recalls whose item_id can still be NULL (e.g. after 'Revert waiting status'), which logs "Use of uninitialized value in numeric eq (==)" in plack-*error.log. -- You are receiving this mail because: You are watching all bug changes.