Bug 18150 - CanItemBeReserved doesn't work with (IndependentBranches AND ! canreservefromotherbranches)
Summary: CanItemBeReserved doesn't work with (IndependentBranches AND ! canreservefrom...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P4 major (vote)
Assignee: Nicolas Legrand
QA Contact: Testopia
URL:
Keywords:
Depends on: 14695
Blocks:
  Show dependency treegraph
 
Reported: 2017-02-22 09:10 UTC by Nicolas Legrand
Modified: 2019-06-27 09:24 UTC (History)
5 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 18150 - CanItemBeReserved doesn't work with (IndependentBranches AND ! canreservefromotherbranches) (1.47 KB, patch)
2017-02-22 09:33 UTC, Nicolas Legrand
Details | Diff | Splinter Review
[SIGNED OFF] Bug 18150 - CanItemBeReserved doesn't work with (IndependentBranches AND ! canreservefromotherbranches) (1.53 KB, patch)
2017-03-06 23:34 UTC, Christopher Brannon
Details | Diff | Splinter Review
[SIGNED OFF] Bug 18150 - CanItemBeReserved doesn't work with (IndependentBranches AND ! canreservefromotherbranches) (1.53 KB, patch)
2017-03-06 23:39 UTC, Christopher Brannon
Details | Diff | Splinter Review
Bug 18150 - CanItemBeReserved doesn't work with (IndependentBranches AND ! canreservefromotherbranches) (1.69 KB, patch)
2017-03-07 19:56 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Legrand 2017-02-22 09:10:00 UTC
If you have independent branches and forbid holds between branches you won't be able to place a hold on an item you should be able to reserve. This is because it tests the item homebranch as if the $item variable was a hash whereas, if it did began as such, by the middle of the function it is replaced by a Koha object.

So $item->{homebranch} should be $item->homebranch.

Patch coming soon.
Comment 1 Nicolas Legrand 2017-02-22 09:30:24 UTC
Also affects 16.11
Comment 2 Nicolas Legrand 2017-02-22 09:33:12 UTC
Created attachment 60542 [details] [review]
Bug 18150 - CanItemBeReserved doesn't work with (IndependentBranches AND ! canreservefromotherbranches)

The variable $item used to be a hash, but at the end of the function,
it's a Koha object. As $item->{homebranch} doesn't yield anything and
should be $item->homebranch. It prevents people using different
branches without holds between branches from placing a hold on an item
they should be able to place hold on.

Test plan:

1. Before patch

  a. with IndependantBranches off
  b. try to place hold on an item you should be able to place hold on
  c. it should work
  d. put IndependantBranches on and canreservefromotherbranches off
  e. shouldn't work

2. after patches redo steps from (1) and everything should be working
fine.
Comment 3 Christopher Brannon 2017-03-06 23:34:34 UTC
Created attachment 60853 [details] [review]
[SIGNED OFF] Bug 18150 - CanItemBeReserved doesn't work with (IndependentBranches AND ! canreservefromotherbranches)

The variable $item used to be a hash, but at the end of the function,
it's a Koha object. As $item->{homebranch} doesn't yield anything and
should be $item->homebranch. It prevents people using different
branches without holds between branches from placing a hold on an item
they should be able to place hold on.

Test plan:

1. Before patch

  a. with IndependantBranches off
  b. try to place hold on an item you should be able to place hold on
  c. it should work
  d. put IndependantBranches on and canreservefromotherbranches off
  e. shouldn't work

2. after patches redo steps from (1) and everything should be working
fine.

Signed-off-by: Your Full Name <your_email>
Comment 4 Christopher Brannon 2017-03-06 23:39:12 UTC
Created attachment 60854 [details] [review]
[SIGNED OFF] Bug 18150 - CanItemBeReserved doesn't work with (IndependentBranches AND ! canreservefromotherbranches)

The variable $item used to be a hash, but at the end of the function,
it's a Koha object. As $item->{homebranch} doesn't yield anything and
should be $item->homebranch. It prevents people using different
branches without holds between branches from placing a hold on an item
they should be able to place hold on.

Test plan:

1. Before patch

  a. with IndependantBranches off
  b. try to place hold on an item you should be able to place hold on
  d. put IndependantBranches on and canreservefromotherbranches off
  e. shouldn't work

2. after patches redo steps from (1) and everything should be working
fine.

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Comment 5 Jonathan Druart 2017-03-07 19:56:48 UTC
Created attachment 60901 [details] [review]
Bug 18150 - CanItemBeReserved doesn't work with (IndependentBranches AND ! canreservefromotherbranches)

The variable $item used to be a hash, but at the end of the function,
it's a Koha object. As $item->{homebranch} doesn't yield anything and
should be $item->homebranch. It prevents people using different
branches without holds between branches from placing a hold on an item
they should be able to place hold on.

Test plan:

1. Before patch

  a. with IndependantBranches off
  b. try to place hold on an item you should be able to place hold on
  c. it should work
  d. put IndependantBranches on and canreservefromotherbranches off
  e. shouldn't work

2. after patches redo steps from (1) and everything should be working
fine.

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Note: Item is fetched twice, it's not necessary. But out of the scope of
this patch.
Comment 6 Brendan Gallagher 2017-03-23 08:48:51 UTC
Pushed to Master - Should be in the 17.05 release.  Thanks!
Comment 7 Katrin Fischer 2017-03-26 20:30:18 UTC
This patch has been pushed to 16.11.x and will be in 16.11.06.