https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39532

Martin Renvoize (ashimema) <martin.renvo...@openfifth.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #181335|0                           |1
        is obsolete|                            |

--- Comment #4 from Martin Renvoize (ashimema) 
<martin.renvo...@openfifth.co.uk> ---
Created attachment 182271
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182271&action=edit
Bug 39532: Script debar_patrons_with_fines.pl creates repeat restrictions, uses
wrong restriction type

The cronjob debar_patrons_with_fines.pl is meant to add a restriction based on
a fines threshold.

The problem is that the script adds a MANUAL restriction, which makes no sense.
MANUAL restrictions are meant to be manually created, never automatic as this
script does.
In addition, they are repeatable, not unique. Every time this script runs, it
will add an additional restriction.

There is already a restriction type meant for this type of use case: SUSPENSION
We should change this script to create SUSPENSION restrictions instead of
MANUAL restrictions.

In summary, this script should use the unique restriction type SUSPENSION to
prevent multiple additional restrictions from being created on each run.

Test Plan:
1) Set up a patron with fines
2) Run misc/cronjobs/debar_patrons_with_fines.pl -c -m "Test message"
3) Note the restriction is created
4) Run misc/cronjobs/debar_patrons_with_fines.pl -c -m "Test message" again
5) Note another restriction is created
6) Delete the restrictions
7) Apply this patch
8) Run misc/cronjobs/debar_patrons_with_fines.pl -c -m "Test message"
9) Note the restriction is created
10) Run misc/cronjobs/debar_patrons_with_fines.pl -c -m "Test message" again
11) Note another restriction is *not* created!

Signed-off-by: Magnus Enger <mag...@libriotech.no>
Signed-off-by: Emmi Takkinen <emmi.takki...@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvo...@openfifth.co.uk>

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

Reply via email to