Summary: | Number of patrons on a patron list not accurate | ||
---|---|---|---|
Product: | Koha | Reporter: | Marcel de Rooy <m.de.rooy> |
Component: | Patrons | Assignee: | Fridolin Somers <fridolin.somers> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | bgkriegel, fridolin.somers, gmcharlt, koha.aixmarseille, kyle.m.hall, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 10565 | ||
Bug Blocks: | |||
Attachments: |
Bug 11857 - Number of patrons on a patron list not accurate
[SIGNED-OFF] Bug 11857 - Number of patrons on a patron list not accurate [PASSED QA] Bug 11857 - Number of patrons on a patron list not accurate |
Description
Marcel de Rooy
2014-02-27 08:47:41 UTC
Just mentioning that when I saw Koha/List/Patron.pm for the first time, I really had no idea what it was. Too much abstraction perhaps :) Since we already have lists (virtual shelves), I would have preferred a class like PatronList. Adding something different in the Koha/List folder would probably just add to the confusion. And even more confusing: pref AddPatronLists.. Has nothing to do with patron lists at all. Created attachment 28674 [details] [review] Bug 11857 - Number of patrons on a patron list not accurate When creating a patron list with only 1 patron, the patron lists page says that the list contains 3 patrons. When creating a patron list with only 1 patron, it works fine. This is caused by the fact that access on "patron_list_patrons" Koha::Schema::Result::PatronList object retruns an hash if one result and an array if more results. See similar problem at http://permalink.gmane.org/gmane.comp.lang.perl.modules.template-toolkit/7250 This patch replaces by the call on resultset and then the use of "count" method. Test plan : - Go to patron lists : /cgi-bin/koha/patron_lists/lists.pl - Create a new patron list LIO - Add one patron - Create a new patron list LIM - Add 2 patrons - Go to patron lists : /cgi-bin/koha/patron_lists/lists.pl => Without this patch you see : Name Patrons in list LIO 3 LIM 2 => With this patch you see : Name Patrons in list LIO 1 LIM 2 I'm not 100% sure how the patch works, I'm new to DBIx. Created attachment 28725 [details] [review] [SIGNED-OFF] Bug 11857 - Number of patrons on a patron list not accurate When creating a patron list with only 1 patron, the patron lists page says that the list contains 3 patrons. When creating a patron list with only 1 patron, it works fine. This is caused by the fact that access on "patron_list_patrons" Koha::Schema::Result::PatronList object retruns an hash if one result and an array if more results. See similar problem at http://permalink.gmane.org/gmane.comp.lang.perl.modules.template-toolkit/7250 This patch replaces by the call on resultset and then the use of "count" method. Test plan : - Go to patron lists : /cgi-bin/koha/patron_lists/lists.pl - Create a new patron list LIO - Add one patron - Create a new patron list LIM - Add 2 patrons - Go to patron lists : /cgi-bin/koha/patron_lists/lists.pl => Without this patch you see : Name Patrons in list LIO 3 LIM 2 => With this patch you see : Name Patrons in list LIO 1 LIM 2 Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Work as described, no koha-qa errors. Created attachment 28728 [details] [review] [PASSED QA] Bug 11857 - Number of patrons on a patron list not accurate When creating a patron list with only 1 patron, the patron lists page says that the list contains 3 patrons. When creating a patron list with only 1 patron, it works fine. This is caused by the fact that access on "patron_list_patrons" Koha::Schema::Result::PatronList object returns an hash if one result and an array if more results. See similar problem at http://permalink.gmane.org/gmane.comp.lang.perl.modules.template-toolkit/7250 This patch replaces by the call on resultset and then the use of "count" method. Test plan : - Go to patron lists : /cgi-bin/koha/patron_lists/lists.pl - Create a new patron list LIO - Add one patron - Create a new patron list LIM - Add 2 patrons - Go to patron lists : /cgi-bin/koha/patron_lists/lists.pl => Without this patch you see : Name Patrons in list LIO 3 LIM 2 => With this patch you see : Name Patrons in list LIO 1 LIM 2 Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Work as described, no koha-qa errors. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Passes all tests and QA script. Confirmed the problem and that the patch fixes it. Patch pushed to master. Thanks Fridolin! Pushed to 3.16.x for inclusion in 3.16.2. |