If a patron has duplicate accountno's for two different fines in Koha this will trigger the error usi_escape: Unmatched [ in regex; marked by <-- HERE in m/([ <-- HERE ])/ at (eval 133) line 1. upon attempt to pay. How those accountno's get duplicated is unknown, but considering accountno is somewhat vestigial at this point in time, it would be much more sensible to use accountlines_id which is has guaranteed uniqueness at the database level.
Created attachment 40807 [details] [review] Bug 14498 - uri_escape error triggered by duplicate accountno's for patron If a patron has duplicate accountno's for two different fines in Koha this will trigger the error usi_escape: Unmatched [ in regex; marked by <-- HERE in m/([ <-- HERE ])/ at (eval 133) line 1. upon attempt to pay. How those accountno's get duplicated is unknown, but considering accountno is somewhat vestigial at this point in time, it would be much more sensible to use accountlines_id which is has guaranteed uniqueness at the database level. Test Plan: 1) Create a patron with 2 fines 2) Edit the accountno's for those fines and set them to 0 3) Attempt to pay one, note the error 4) Apply this patch 5) Refesh the page 6) Attempt to pay one, no error this time! 7) Test Pay, Write off, Pay amount, Write off all, and Pay selected
Created attachment 40808 [details] [review] Bug 14498 - uri_escape error triggered by duplicate accountno's for patron If a patron has duplicate accountno's for two different fines in Koha this will trigger the error usi_escape: Unmatched [ in regex; marked by <-- HERE in m/([ <-- HERE ])/ at (eval 133) line 1. upon attempt to pay. How those accountno's get duplicated is unknown, but considering accountno is somewhat vestigial at this point in time, it would be much more sensible to use accountlines_id which is has guaranteed uniqueness at the database level. Test Plan: 1) Create a patron with 2 fines 2) Edit the accountno's for those fines and set them to 0 3) Attempt to pay one, note the error 4) Apply this patch 5) Refesh the page 6) Attempt to pay one, no error this time! 7) Test Pay, Write off, Pay amount, Write off all, and Pay selected
Created attachment 40810 [details] [review] Bug 14498 - uri_escape error triggered by duplicate accountno's for patron If a patron has duplicate accountno's for two different fines in Koha this will trigger the error usi_escape: Unmatched [ in regex; marked by <-- HERE in m/([ <-- HERE ])/ at (eval 133) line 1. upon attempt to pay. How those accountno's get duplicated is unknown, but considering accountno is somewhat vestigial at this point in time, it would be much more sensible to use accountlines_id which is has guaranteed uniqueness at the database level. Test Plan: 1) Create a patron with 2 fines 2) Edit the accountno's for those fines and set them to 0 3) Attempt to pay one, note the error 4) Apply this patch 5) Refesh the page 6) Attempt to pay one, no error this time! 7) Test Pay, Write off, Pay amount, Write off all, and Pay selected Signed-off-by: Deborah Duce <deborah.duce@huntsvillelibrary.ca>
> 2) Edit the accountno's for those fines and set them to 0 I suppose you mean by editing the row in DB using the sql CLI? Do you have an idea how it's possible to generate 2 rows with the same accountno for the same patron?
(In reply to Jonathan Druart from comment #4) > > 2) Edit the accountno's for those fines and set them to 0 > > I suppose you mean by editing the row in DB using the sql CLI? That is correct > Do you have an idea how it's possible to generate 2 rows with the same > accountno for the same patron? I this point I do not know how the situation is occurring.
I suspect this may be a data migration issue where the lines in the accountlines are not added with a tool that sequences them. I cannot think of a way where Koha would create this natively.
Created attachment 41602 [details] [review] Bug 14498 - uri_escape error triggered by duplicate accountno's for patron If a patron has duplicate accountno's for two different fines in Koha this will trigger the error usi_escape: Unmatched [ in regex; marked by <-- HERE in m/([ <-- HERE ])/ at (eval 133) line 1. upon attempt to pay. How those accountno's get duplicated is unknown, but considering accountno is somewhat vestigial at this point in time, it would be much more sensible to use accountlines_id which is has guaranteed uniqueness at the database level. Test Plan: 1) Create a patron with 2 fines 2) Edit the accountno's for those fines and set them to 0 3) Attempt to pay one, note the error 4) Apply this patch 5) Refesh the page 6) Attempt to pay one, no error this time! 7) Test Pay, Write off, Pay amount, Write off all, and Pay selected Signed-off-by: Deborah Duce <deborah.duce@huntsvillelibrary.ca> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Patch pushed to master. Thanks Kyle!