[Koha-bugs] [Bug 16534] Error when checking out already checked out item ( depending on AllowReturnToBranch)

2016-08-16 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

Julian Maurice  changed:

   What|Removed |Added

 CC||julian.maur...@biblibre.com

--- Comment #36 from Julian Maurice  ---
Patches pushed to 3.22.x, will be in 3.22.10

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item ( depending on AllowReturnToBranch)

2016-08-01 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

Frédéric Demians  changed:

   What|Removed |Added

 Status|Pushed to Master|Pushed to Stable

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/

[Koha-bugs] [Bug 16534] Error when checking out already checked out item ( depending on AllowReturnToBranch)

2016-08-01 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

Frédéric Demians  changed:

   What|Removed |Added

 CC||frede...@tamil.fr

--- Comment #35 from Frédéric Demians  ---
Pushed in 16.05. Will be in 16.05.02.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/

[Koha-bugs] [Bug 16534] Error when checking out already checked out item (depending on AllowReturnToBranch)

2016-06-24 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

Kyle M Hall  changed:

   What|Removed |Added

 Status|Passed QA   |Pushed to Master
 CC||k...@bywatersolutions.com

--- Comment #34 from Kyle M Hall  ---
Pushed to master for 16.11! Thanks Jonathan!

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item (depending on AllowReturnToBranch)

2016-06-17 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

--- Comment #33 from Kyle M Hall  ---
Created attachment 52493
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=52493=edit
Bug 16534: (followup) - Tidy AddIssue

Signed-off-by: Kyle M Hall 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item (depending on AllowReturnToBranch)

2016-06-17 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

--- Comment #31 from Kyle M Hall  ---
Created attachment 52491
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=52491=edit
Bug 16534: Block AddIssue from issuing if the return is not possible

To make sure the return can be done, AddIssue must not trust callers (they
should have done their job, but we are not sure) and check that the issue can
be returned before issuing to the patron.

There is no test plan here, this should not be possible from the Koha
interface.
However, looking at the code, it may be possible using SIP.

Signed-off-by: Marc Véron 

Signed-off-by: Kyle M Hall 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/

[Koha-bugs] [Bug 16534] Error when checking out already checked out item (depending on AllowReturnToBranch)

2016-06-17 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

--- Comment #32 from Kyle M Hall  ---
Created attachment 52492
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=52492=edit
Bug 16534: (followup) Correct tiny typo

This patch corrects "...must be return..." to "must be returned..."

Signed-off-by: Kyle M Hall 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item (depending on AllowReturnToBranch)

2016-06-17 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

--- Comment #30 from Kyle M Hall  ---
Created attachment 52490
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=52490=edit
Bug 16534: Add tests for AddIssue

Signed-off-by: Marc Véron 

Signed-off-by: Kyle M Hall 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/

[Koha-bugs] [Bug 16534] Error when checking out already checked out item (depending on AllowReturnToBranch)

2016-06-17 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

Kyle M Hall  changed:

   What|Removed |Added

 Status|Signed Off  |Passed QA

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item (depending on AllowReturnToBranch)

2016-06-17 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

Kyle M Hall  changed:

   What|Removed |Added

  Attachment #51706|0   |1
is obsolete||
  Attachment #51707|0   |1
is obsolete||
  Attachment #51708|0   |1
is obsolete||
  Attachment #51709|0   |1
is obsolete||
  Attachment #51710|0   |1
is obsolete||

--- Comment #27 from Kyle M Hall  ---
Created attachment 52487
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=52487=edit
Bug 16534: Add tests for CanBookBeIssued & AllowReturnToBranch

Signed-off-by: Marc Véron 

Signed-off-by: Kyle M Hall 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/

[Koha-bugs] [Bug 16534] Error when checking out already checked out item (depending on AllowReturnToBranch)

2016-06-17 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

--- Comment #29 from Kyle M Hall  ---
Created attachment 52489
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=52489=edit
Bug 16534: Make CanBookBeIssued test if the issue can be returned

If an issue is already checked out, CanBookBeIssued must check if the
issue can be checked in before processing the return.
In such cases (depending of the AllowReturnToBranch pref), the issue
should not be allowed.

Prior to this patch, the checkin was not done and the checkout failed
with "Duplicate entry '1204321' for key 'itemnumber'". Indeed since bug
14978, there is an uniq key on issues.itemnumber. Before bug 14978 the
issue existed but was hidden (and some weird behaviors certainly
happened!).

To avoid Koha to crash, a check is added to CanBookBeIssued (call to
CanBookBeReturned) and the librarian is not able to process the
checkout.

Test plan:

- Set AllowReturnToBranch to anywhere
- Check an item (homebranch Library 1, holding branch Library 1) out from
Library 1
- Check the item out from Library 2
=> Confirm the checkout (should work with and without this patch)

- Set AllowReturnToBranch to holdinbranch ("only the library the item
  was checked out from").
- Check an item (homebranch Library 1, holding branch Library 1) out from
Library 1
- Check the item out from Library 2
=> Without this patch, Koha crashed
=> With this patch, you will be warned that the checkin is not possible.

Try other combinations of the AllowReturnToBranch syspref

Followed test plan, works as expected
Signed-off-by: Marc Véron 

Signed-off-by: Kyle M Hall 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/

[Koha-bugs] [Bug 16534] Error when checking out already checked out item (depending on AllowReturnToBranch)

2016-06-17 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

Kyle M Hall  changed:

   What|Removed |Added

  Attachment #52487|0   |1
is obsolete||

--- Comment #28 from Kyle M Hall  ---
Created attachment 52488
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=52488=edit
Bug 16534: Add tests for CanBookBeIssued & AllowReturnToBranch

Signed-off-by: Marc Véron 

Signed-off-by: Kyle M Hall 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/

[Koha-bugs] [Bug 16534] Error when checking out already checked out item (depending on AllowReturnToBranch)

2016-05-23 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

--- Comment #26 from Theodoros Theodoropoulos  ---
Thank you all for your interest and almost instant response to the bug!
It seemed critical (especially if one doesn't have patch for 14978), but it's
normal that it wasn't spotted before as it appears only under certain
circumstances.

I have not yet tried the patch, but seeing the code and your description, I am
certain that it will solve the problem that we faced!

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item (depending on AllowReturnToBranch)

2016-05-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

Marc Véron  changed:

   What|Removed |Added

 Status|Needs Signoff   |Signed Off

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/

[Koha-bugs] [Bug 16534] Error when checking out already checked out item (depending on AllowReturnToBranch)

2016-05-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

--- Comment #25 from Marc Véron  ---
Created attachment 51710
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=51710=edit
Bug 16534: (followup) Correct tiny typo

This patch corrects "...must be return..." to "must be returned..."

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/

[Koha-bugs] [Bug 16534] Error when checking out already checked out item (depending on AllowReturnToBranch)

2016-05-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

Marc Véron  changed:

   What|Removed |Added

  Attachment #51700|0   |1
is obsolete||

--- Comment #24 from Marc Véron  ---
Created attachment 51709
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=51709=edit
Bug 16534: Block AddIssue from issuing if the return is not possible

To make sure the return can be done, AddIssue must not trust callers (they
should have done their job, but we are not sure) and check that the issue can
be returned before issuing to the patron.

There is no test plan here, this should not be possible from the Koha
interface.
However, looking at the code, it may be possible using SIP.

Signed-off-by: Marc Véron 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/

[Koha-bugs] [Bug 16534] Error when checking out already checked out item (depending on AllowReturnToBranch)

2016-05-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

Marc Véron  changed:

   What|Removed |Added

  Attachment #51699|0   |1
is obsolete||

--- Comment #23 from Marc Véron  ---
Created attachment 51708
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=51708=edit
Bug 16534: Add tests for AddIssue

Signed-off-by: Marc Véron 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/

[Koha-bugs] [Bug 16534] Error when checking out already checked out item (depending on AllowReturnToBranch)

2016-05-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

Marc Véron  changed:

   What|Removed |Added

  Attachment #51698|0   |1
is obsolete||

--- Comment #22 from Marc Véron  ---
Created attachment 51707
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=51707=edit
Bug 16534: Make CanBookBeIssued test if the issue can be returned

If an issue is already checked out, CanBookBeIssued must check if the
issue can be checked in before processing the return.
In such cases (depending of the AllowReturnToBranch pref), the issue
should not be allowed.

Prior to this patch, the checkin was not done and the checkout failed
with "Duplicate entry '1204321' for key 'itemnumber'". Indeed since bug
14978, there is an uniq key on issues.itemnumber. Before bug 14978 the
issue existed but was hidden (and some weird behaviors certainly
happened!).

To avoid Koha to crash, a check is added to CanBookBeIssued (call to
CanBookBeReturned) and the librarian is not able to process the
checkout.

Test plan:

- Set AllowReturnToBranch to anywhere
- Check an item (homebranch Library 1, holding branch Library 1) out from
Library 1
- Check the item out from Library 2
=> Confirm the checkout (should work with and without this patch)

- Set AllowReturnToBranch to holdinbranch ("only the library the item
  was checked out from").
- Check an item (homebranch Library 1, holding branch Library 1) out from
Library 1
- Check the item out from Library 2
=> Without this patch, Koha crashed
=> With this patch, you will be warned that the checkin is not possible.

Try other combinations of the AllowReturnToBranch syspref

Followed test plan, works as expected
Signed-off-by: Marc Véron 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/

[Koha-bugs] [Bug 16534] Error when checking out already checked out item (depending on AllowReturnToBranch)

2016-05-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

Marc Véron  changed:

   What|Removed |Added

  Attachment #51697|0   |1
is obsolete||

--- Comment #21 from Marc Véron  ---
Created attachment 51706
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=51706=edit
Bug 16534: Add tests for CanBookBeIssued & AllowReturnToBranch

Signed-off-by: Marc Véron 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/

[Koha-bugs] [Bug 16534] Error when checking out already checked out item (depending on AllowReturnToBranch)

2016-05-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

Marc Véron  changed:

   What|Removed |Added

 CC||ve...@veron.ch

--- Comment #20 from Marc Véron  ---
Reproduced on current master.
Testing...
All patches applied.
Error is gone.

Test t/db_dependent/Circulation.t pass (with empty tables reserves,
old_reserves, old_issues)

Reset, apply patches for t/db_dependent/Circulation.t only
Test t/db_dependent/Circulation.t do not pass (as expected)

Going to sign-off

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/

[Koha-bugs] [Bug 16534] Error when checking out already checked out item (depending on AllowReturnToBranch)

2016-05-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

Jonathan Druart  changed:

   What|Removed |Added

Summary|Error when checking out |Error when checking out
   |already checked out item|already checked out item
   ||(depending on
   ||AllowReturnToBranch)

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item

2016-05-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

Jonathan Druart  changed:

   What|Removed |Added

 Depends on||13790, 14978
   Severity|major   |critical

--- Comment #19 from Jonathan Druart  
---
I think this is a critical for versions with and without bug 13790 and bug
14978. Feel free to lower the severity if you think I am wrong.


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13790
[Bug 13790] Add unique id issue_id to issues and old_issues tables
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14978
[Bug 14978] issues.itemnumber should be a unique key
-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item

2016-05-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

--- Comment #18 from Jonathan Druart  
---
(In reply to Jonathan Druart from comment #17)
> Created attachment 51700 [details] [review]
> Bug 16534: Block AddIssue from issuing if the return is not possible
> 
> To make sure the return can be done, AddIssue must not trust callers (they
> should have done their job, but we are not sure) and check that the issue can
> be returned before issuing to the patron.
> 
> There is no test plan here, this should not be possible from the Koha
> interface.
> However, looking at the code, it may be possible using SIP.

This commit message is awful and does not meant anything but I hope it will be
understood anyway :D

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item

2016-05-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

Jonathan Druart  changed:

   What|Removed |Added

  Attachment #51687|0   |1
is obsolete||

--- Comment #14 from Jonathan Druart  
---
Created attachment 51697
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=51697=edit
Bug 16534: Add tests for CanBookBeIssued & AllowReturnToBranch

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item

2016-05-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

--- Comment #17 from Jonathan Druart  
---
Created attachment 51700
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=51700=edit
Bug 16534: Block AddIssue from issuing if the return is not possible

To make sure the return can be done, AddIssue must not trust callers (they
should have done their job, but we are not sure) and check that the issue can
be returned before issuing to the patron.

There is no test plan here, this should not be possible from the Koha
interface.
However, looking at the code, it may be possible using SIP.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item

2016-05-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

--- Comment #15 from Jonathan Druart  
---
Created attachment 51698
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=51698=edit
Bug 16534: Make CanBookBeIssued test if the issue can be returned

If an issue is already checked out, CanBookBeIssued must check if the
issue can be checked in before processing the return.
In such cases (depending of the AllowReturnToBranch pref), the issue
should not be allowed.

Prior to this patch, the checkin was not done and the checkout failed
with "Duplicate entry '1204321' for key 'itemnumber'". Indeed since bug
14978, there is an uniq key on issues.itemnumber. Before bug 14978 the
issue existed but was hidden (and some weird behaviors certainly
happened!).

To avoid Koha to crash, a check is added to CanBookBeIssued (call to
CanBookBeReturned) and the librarian is not able to process the
checkout.

Test plan:

- Set AllowReturnToBranch to anywhere
- Check an item (homebranch Library 1, holding branch Library 1) out from
Library 1
- Check the item out from Library 2
=> Confirm the checkout (should work with and without this patch)

- Set AllowReturnToBranch to holdinbranch ("only the library the item
  was checked out from").
- Check an item (homebranch Library 1, holding branch Library 1) out from
Library 1
- Check the item out from Library 2
=> Without this patch, Koha crashed
=> With this patch, you will be warned that the checkin is not possible.

Try other combinations of the AllowReturnToBranch syspref

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item

2016-05-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

--- Comment #16 from Jonathan Druart  
---
Created attachment 51699
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=51699=edit
Bug 16534: Add tests for AddIssue

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item

2016-05-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

Jonathan Druart  changed:

   What|Removed |Added

 Status|ASSIGNED|Needs Signoff

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item

2016-05-21 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

Jonathan Druart  changed:

   What|Removed |Added

   Assignee|koha-b...@lists.koha-commun |jonathan.dru...@bugs.koha-c
   |ity.org |ommunity.org
Version|3.20|unspecified
 Status|NEW |ASSIGNED

--- Comment #13 from Jonathan Druart  
---
This patch should do the trick, but I will need to write some tests to make it
pushable.

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item

2016-05-21 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

--- Comment #12 from Jonathan Druart  
---
Created attachment 51687
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=51687=edit
Bug 16534: Do not process the checkout if the checkin has failed

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item

2016-05-18 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

--- Comment #11 from Theodoros Theodoropoulos  ---
> So do you think in this case Koha should not allow to perform the
> checkin+checkout ? Since checkin needs a transfer.

Well, this sounds like the correct way to go...

In any case, the process should not try to chekout the item to another patron
(and try to create the duplicate line in the issues table) because the checkin
process (no matter what the reason) was not complete.

[Hmm... Maybe add an extra step in the checkin process to check if the checkin
process completed without errors and only then proceed with the checkout?]

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item

2016-05-18 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

Fridolin SOMERS  changed:

   What|Removed |Added

 CC||fridolin.som...@biblibre.co
   ||m

--- Comment #10 from Fridolin SOMERS  ---
(In reply to Theodoros Theodoropoulos from comment #9)
> The culprit /seems/ to be AllowReturnToBranch.
> 
> (Setting it to "Any library" prevents you from getting the error. Setting it
> to "Allow materials to be returned to only the library the item is from"
> produces the error)

So do you think in this case Koha should not allow to perform the
checkin+checkout ? Since checkin needs a transfer.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item

2016-05-17 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

--- Comment #9 from Theodoros Theodoropoulos  ---
The culprit /seems/ to be AllowReturnToBranch.

(Setting it to "Any library" prevents you from getting the error. Setting it to
"Allow materials to be returned to only the library the item is from" produces
the error)

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item

2016-05-17 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

--- Comment #8 from Theodoros Theodoropoulos  ---
I've tested changing sysprefs in my v3.22.06.005 sandbox and it seems that one
of the following parameters is related to the error!

AutomaticItemReturn: Don't
UseBranchTransferLimits: Enforce library transfer limits based on Item type
IndependentBranches: Don't prevent
AllowReturnToBranch: Allow materials to be returned to only the library the
item is from
AutomaticItemReturn: Don't automatically transfer items to their home library
when they are returned.

@Jonathan, can you please set them in your test installation and verify if you
get the duplicate key error?

...we're getting close...

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item

2016-05-17 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

--- Comment #7 from Theodoros Theodoropoulos  ---
I couldn't reproduce it in a testing environment running v3.22.06.005

But I reproduced it several times in our production/test systems running
v3.20.10
Maybe(?) it's also related to a system preference that we have and/or
patron/item specific value.

(I also created MT18564, I'll give you login details for our test server and
example patron/items for you to play with)

Thank you for your time. Oh, and I forgot to mention that credits also go to
Fridolin Somers for pointing out that we still had items in this status and
identifying them to us. When we first encountered the issue, we fixed it from
Koha GUI. Thinking that it was a one-of issue, we didn't pay much attention to
it until it happened another 2 times in a short period of time.

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item

2016-05-17 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

--- Comment #6 from Jonathan Druart  
---
Are you able to reproduce the error on a sandbox or using the master branch?

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item

2016-05-17 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

--- Comment #5 from Jonathan Druart  
---
(In reply to Theodoros Theodoropoulos from comment #4)
> @Jonathan:
> 
> Can you please run:
> SELECT itemnumber,COUNT(*) AS nb FROM issues GROUP BY itemnumber HAVING nb >
> 1;
> 
> If you get any lines, then you DO have the problem. You simple don't get the
> error because you currently don't have the Unique Key constraint in the DB

I have the unique key constraint.

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item

2016-05-17 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

--- Comment #4 from Theodoros Theodoropoulos  ---
@Jonathan:

Can you please run:
SELECT itemnumber,COUNT(*) AS nb FROM issues GROUP BY itemnumber HAVING nb > 1;

If you get any lines, then you DO have the problem. You simple don't get the
error because you currently don't have the Unique Key constraint in the DB

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item

2016-05-17 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

--- Comment #3 from Theodoros Theodoropoulos  ---
@Jonathan:

Unfortunately, I cannot reproduce anymore the error for Koha<3.20.06 because we
have upgraded both our test/production servers to 3.20.10.
All I know is that BEFORE the upgrade we had 3 cases where duplicate lines
(with the same itemnumber) were found in issues table. This means an item was
found to be checked out to two different borrowers (at the same time). (I have
a screenshot to prove it for one of them).

After discussing with the librarians, they explained that all they did was they
have checked out an already-checked out item to another patron. They DIDN'T get
any error and the item ended up to be checkout to BOTH patron. 

With 3.20.10 now, the new error that appears means that Circulation.pm TRIES to
create a duplicate line in issues (but fails), so the item is NOT checked out
to the new patron in the end (but it would have been if it wasn't for the new
unique key in the DB).

The correct behavior is the item to be checked in and then checked out to the
new patron.

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item

2016-05-17 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

Jonathan Druart  changed:

   What|Removed |Added

 CC||jonathan.dru...@bugs.koha-c
   ||ommunity.org

--- Comment #2 from Jonathan Druart  
---
I do not reproduce the error with the following steps:
- Check an item (home library is L1) out to Patron P1 (from library L2)
- Check the same item out to patron P2 (from library L3)

Note that I do not use a fresh DB created from 3.20.06, it could make a
difference.

Could you please confirm you do not get any errors in the Koha log file about
the checkin? This error should not appear if the checkin has been correctly
done.

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item

2016-05-17 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

Theodoros Theodoropoulos  changed:

   What|Removed |Added

   See Also||https://bugs.koha-community
   ||.org/bugzilla3/show_bug.cgi
   ||?id=14978

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/


[Koha-bugs] [Bug 16534] Error when checking out already checked out item

2016-05-17 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16534

--- Comment #1 from Theodoros Theodoropoulos  ---
Steps to reproduce:

- Check out item X in patron A (item belonging to branch B1)
- Go to circulation, select patron B (from branch B2!=B1)
- Try to check-out the same item X to patron B
- You get a warning (Please confirm checkout Item X is checked out to A. Check
in and check out?). Click Yes
- You get either the Duplicate entry error / or the duplicate entry in issues
table


[update] Newer tests indicate that the only requirement to get the error is:
ITEM X must belong to a different branch than patron A/B (regardless of which
branch patron A and patron B belong to).

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://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/