Summary: | Pickup library not set correctly when using Default holds policy by item type | ||
---|---|---|---|
Product: | Koha | Reporter: | Caroline Cyr La Rose <caroline.cyr-la-rose> |
Component: | Hold requests | Assignee: | Maryse Simard <maryse.simard> |
Status: | CLOSED FIXED | QA Contact: | Martin Renvoize (ashimema) <martin.renvoize> |
Severity: | minor | ||
Priority: | P5 - low | CC: | gmcharlt, klas.blomberg, lucas, martin.renvoize, maryse.simard, nick |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
19.05.00, 18.11.05
|
|
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 33074 | ||
Attachments: |
Bug 21263: Pickup library not set correctly when using Default holds policy
Bug 21263: Pickup library not set correctly when using Default holds policy Bug 21263: Pickup library not set correctly when using Default holds policy |
Description
Caroline Cyr La Rose
2018-08-23 14:54:42 UTC
Created attachment 84846 [details] [review] Bug 21263: Pickup library not set correctly when using Default holds policy In the case of a specific item hold, it can only be fulfilled if the pickup library matches the hold fulfillment policy. Therefore, if OPACAllowUserToChooseBranch is set to don't allow, the pickup library should correspond to the policy. In case of hold that does not specify an item, the homebranch or holdingbranch can't be determined at this time, so the pickup library still defaults to the homebranch of the borrower. Same if there is no policy or it states 'any'. To test: - Make sure OPACAllowUserToChooseBranch is set to don't allow - Make sure you have two branches A and B - Have one item whose homebranch is B - Have one user whose homebranch is A - Make sure the circulation rules allow the user to reserve the item's item type 1. Go to Administration > Circulation and fines rules 2. Create a Default holds policy by item type for that item type - Item type = item's item type - Hold policy = From any library - Hold pickup library match = item's home library - Return policy = item returns home 3. Go to the OPAC and log in with the user's credentials 4. Search for the item 5. Click on "Place hold" 6. Select a specific item and confirm hold 7. In the user's file on the OPAC and check the reservation's pickup library. It should be the item's homebranch You can then repeat the steps for 'item's holding library' or 'any library' as the Hold pickup library match. It should also work the same way if there is no 'Default holds policy by item type' for this item type but a 'Default checkout, hold and return policy' set. Finally, check that placing a hold without selecting a specific item still defaults the pickup library to the borrower's homebranch. Created attachment 86335 [details] [review] Bug 21263: Pickup library not set correctly when using Default holds policy In the case of a specific item hold, it can only be fulfilled if the pickup library matches the hold fulfillment policy. Therefore, if OPACAllowUserToChooseBranch is set to don't allow, the pickup library should correspond to the policy. In case of hold that does not specify an item, the homebranch or holdingbranch can't be determined at this time, so the pickup library still defaults to the homebranch of the borrower. Same if there is no policy or it states 'any'. To test: - Make sure OPACAllowUserToChooseBranch is set to don't allow - Make sure you have two branches A and B - Have one item whose homebranch is B - Have one user whose homebranch is A - Make sure the circulation rules allow the user to reserve the item's item type 1. Go to Administration > Circulation and fines rules 2. Create a Default holds policy by item type for that item type - Item type = item's item type - Hold policy = From any library - Hold pickup library match = item's home library - Return policy = item returns home 3. Go to the OPAC and log in with the user's credentials 4. Search for the item 5. Click on "Place hold" 6. Select a specific item and confirm hold 7. In the user's file on the OPAC and check the reservation's pickup library. It should be the item's homebranch You can then repeat the steps for 'item's holding library' or 'any library' as the Hold pickup library match. It should also work the same way if there is no 'Default holds policy by item type' for this item type but a 'Default checkout, hold and return policy' set. Finally, check that placing a hold without selecting a specific item still defaults the pickup library to the borrower's homebranch. Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Created attachment 87582 [details] [review] Bug 21263: Pickup library not set correctly when using Default holds policy In the case of a specific item hold, it can only be fulfilled if the pickup library matches the hold fulfillment policy. Therefore, if OPACAllowUserToChooseBranch is set to don't allow, the pickup library should correspond to the policy. In case of hold that does not specify an item, the homebranch or holdingbranch can't be determined at this time, so the pickup library still defaults to the homebranch of the borrower. Same if there is no policy or it states 'any'. To test: - Make sure OPACAllowUserToChooseBranch is set to don't allow - Make sure you have two branches A and B - Have one item whose homebranch is B - Have one user whose homebranch is A - Make sure the circulation rules allow the user to reserve the item's item type 1. Go to Administration > Circulation and fines rules 2. Create a Default holds policy by item type for that item type - Item type = item's item type - Hold policy = From any library - Hold pickup library match = item's home library - Return policy = item returns home 3. Go to the OPAC and log in with the user's credentials 4. Search for the item 5. Click on "Place hold" 6. Select a specific item and confirm hold 7. In the user's file on the OPAC and check the reservation's pickup library. It should be the item's homebranch You can then repeat the steps for 'item's holding library' or 'any library' as the Hold pickup library match. It should also work the same way if there is no 'Default holds policy by item type' for this item type but a 'Default checkout, hold and return policy' set. Finally, check that placing a hold without selecting a specific item still defaults the pickup library to the borrower's homebranch. Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> I sort of wish this was within the Modules rather than at the controller/script side and as such I could request tests. We could test it via selenium integration tests to prevent regression but that feels like a fairly big ask here. As I can't find any regressions and it appears to work as expected I'm going to PQA.. but I'd love to see a more thorough treatment and unit tests down the line. Awesome work all! Pushed to master for 19.05 Pushed to 18.11.x for 18.11.05 backported to 18.05.x for 18.05.12 I think this patch needs a small adjustment to be more generally useful. We have OPACAllowUserToChooseBranch set to allow as we're a consortium where users frequently use other libraries than their homebranch Sometimes we want to use the combination Hold policy from any library in combination with Hold pickup library match item's home library Default holds policy by item type is still not respected for this combination when this patch is applied Would it work even for us if we delete this condition? if ( ! C4::Context->preference("OPACAllowUserToChooseBranch") |