If a patron has a manual restriction, /cgi-bin/koha/circ/circulation.pl can display a message similar to the following: Patron has had overdue items and is blocked for 2014-09-30 day(s). This is related to sub IsMemberBlocked in C4/Members.pm that returns a date but is expected to return a number of days. It should have an additional status for returning dates instead of days to use in C4/Circulation.pm and circulation.tt
Created attachment 31574 [details] [review] Bug 12914 - Wrong message 'Patron(..) is blocked for 2014-09-30 day(s). The message in circulation.tt assumed to get days but date is given. Updated comments and message depending on expiration date or no expiration of restriction. The message shows up on top of Bug 643 Allow override of 'debarred' status if a patron has a restriction.
Test plan Apply patch on top of Bug 643 Add manual restriction with expiration date to patron A Add manual restriction without expiration date to patron B For both try to check out an item and override restriction (Bug 643) The message for patron A should now be similar to: Patron has a restriction until 04/12/2014. The message for patron B should now read: Patron has a restriction (no expiry date).
Created attachment 32000 [details] [review] [SIGNED OFF] Bug 12914 - Wrong message 'Patron(..) is blocked for 2014-09-30 day(s). The message in circulation.tt assumed to get days but date is given. Updated comments and message depending on expiration date or no expiration of restriction. The message shows up on top of Bug 643 Allow override of 'debarred' status if a patron has a restriction. Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
I cannot reproduce this bug on master with bug 643 applied. I think perhaps the wording of the message has changed to correct this already.
Created attachment 32283 [details] This Screenshots shows the message "Patron has had overdue items and is blocked for 2014-10-31 day(s)." I did a new test on curret master 3.17.00.027 The test was done after applying patches for bug 643. The message appears after checking out to a debarred patron using "Override debarment temorarily". Without patch for Bug 12914 the message reads: "Patron has had overdue items and is blocked for 2014-10-31 day(s)." With patch, it reads: "Patron has a restriction until 31/10/2014." The patch was signed off by Nick Clemens. I kindly ask to switch back status from "Failed QA" to "Signed off"
Hi Marc, looking at this patch I think it should not be using format_date but the Dates template plugin instead. Could you provide a new patch? As this won't change the logic you can set it back to 'signed off'.
Hi Katrin, I had a look at C4/Circulation.pm There are a more calls to the function format_date (that's why I followed this pattern). I suppose that those calls should be replaced as well? If yes, I propose to move the replacement to a separate bug.
You are right that the other ones should be removed as well, but I'd like to not introduce new ones if possible :)
Created attachment 32322 [details] [review] Bug 12914 - Wrong message 'Patron(..) is blocked for 2014-09-30 day(s). The message in circulation.tt assumed to get days but date is given. Updated comments and message depending on expiration date or no expiration of restriction. The message shows up on top of Bug 643 Allow override of 'debarred' status if a patron has a restriction. New patch with replacement of format_date with date template (Comment #6) Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Comment on attachment 32322 [details] [review] Bug 12914 - Wrong message 'Patron(..) is blocked for 2014-09-30 day(s). Oh, something went wront with this patch.
Created attachment 32323 [details] [review] Bug 12914 - Wrong message 'Patron(..) is blocked for 2014-09-30 day(s). The message in circulation.tt assumed to get days but date is given. Updated comments and message depending on expiration date or no expiration of restriction. The message shows up on top of Bug 643 Allow override of 'debarred' status if a patron has a restriction. Replaced date_format with date template (see comment #6) Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Setting back to Signed-off (see comment #6)
Hi Marc, I can't reproduce what I can see in your screenshot. The messages I get look quite different and don't include the date (which they should?). I am attaching a screenshot, could you take a look? How are you setting the restriction? I have tested on top of bug 643.
Created attachment 32403 [details] Screenshot showing messages when overriding debarment
Hi Katrin, It seems that my test plan was not precise enough, sorry... It should read: Add manual restriction with expiration date to patron A Add manual restriction without expiration date to patron B For both: Step a) go to check out Step b) override restriction (Bug 643) Result of this step: like screenshot 2014-10-16 by Katrin Step c) check out an item Result: like Marc's screenshot 2014-10-14 with wrong text. This is fixed by the patch. The message for patron A should now be similar to: Patron has a restriction until 04/12/2014. The message for patron B should now read: Patron has a restriction (no expiry date).
Created attachment 32506 [details] [review] [PASSED QA] Bug 12914 - Wrong message 'Patron(..) is blocked for 2014-09-30 day(s). The message in circulation.tt assumed to get days but date is given. Updated comments and message depending on expiration date or no expiration of restriction. The message shows up on top of Bug 643 Allow override of 'debarred' status if a patron has a restriction. Replaced date_format with date template (see comment #6) Signed-off-by: Nick Clemens <nick@quecheelibrary.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Looks good! I was also looking in the wrong place when I marked as failed qa.
Patch pushed to master. Thanks Marc! Note: It feels it's time to refactor CanBookBeIsued.