[Bug 14480] New: Warns when modifying patron
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 Bug ID: 14480 Summary: Warns when modifying patron Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: aleishaamohia@hotmail.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com To recreate warns, go to any patron page (ie a link such as http://localhost:8081/cgi-bin/koha/members/moremember.pl?borrowernumber=1369) and click 'Edit' memberentry.pl: Argument "" isn't numeric in numeric eq (==) at /home/vagrant/kohaclone/members/memberentry.pl line 566 memberentry.pl: Argument "" isn't numeric in numeric lt (<) at /home/vagrant/kohaclone/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt line 949 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 --- Comment #1 from Aleisha Amohia <aleishaamohia@hotmail.com> --- Created attachment 40744 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40744&action=edit Bug 14480: Silences warns triggered when modifying patron These warns are triggered when editing a patron: memberentry.pl: Argument "" isn't numeric in numeric eq (==) at /home/vagrant/kohaclone/members/memberentry.pl line 566 memberentry.pl: Argument "" isn't numeric in numeric lt (<) at /home/vagrant/kohaclone/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt line 949 To test: 1) Go to any patron (ie this link http://localhost:8081/cgi-bin/koha/members/moremember.pl?borrowernumber=1369) 2) Click Edit 3) Notice the above warns 4) Apply patch and reload page 5) Notice warns are gone but page still works correctly -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |aleishaamohia@hotmail.com |ity.org | CC| |jonathan.druart@biblibre.co | |m Severity|enhancement |minor -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 --- Comment #2 from Jonathan Druart <jonathan.druart@biblibre.com> --- Comment on attachment 40744 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40744 Bug 14480: Silences warns triggered when modifying patron Review of attachment 40744: --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=14480&attachment=40744) ----------------------------------------------------------------- ::: koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ +916,4 @@
<fieldset class="rows"> <legend>Patron restrictions</legend>
+ [% IF ( debarments.size && debarments.size < 1 ) %]
It should be IF debarments and debarments.size That makes more sense. ::: members/memberentry.pl @@ +563,4 @@
if ($default_city) { # flag the current or default val for my $city ( @{$city_arrayref} ) { + if ($default_city eq $city->{cityid}) {
I don't get this warning but cityid is an integer, so == makes sense. $default_city is tested before so cityid is empty? Don't understand how it's possible (comes from the DB, stored as int) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40744|0 |1 is obsolete| | --- Comment #3 from Aleisha Amohia <aleishaamohia@hotmail.com> --- Created attachment 45677 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=45677&action=edit Bug 14480: Silencing warns from editing patron This warn is triggered when editing a patron: Argument "" isn't numeric in numeric lt (<) at /home/vagrant/kohaclone/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt line 974. To test: 1) Go to any patron (ie this link http://localhost:8081/cgi-bin/koha/members/moremember.pl?borrowernumber=1369) 2) Click Edit 3) Notice the above warns 4) Apply patch and reload page 5) Notice warns are gone but page still works correctly -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #4 from Owen Leonard <oleonard@myacpl.org> --- This doesn't work correctly for me. Before the patch, if the patron had no restrictions the restrictions table wouldn't display. Instead there would be a message "Patron is currently unrestricted." After the patch, there is no message and a table with only a header row appears. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #45677|0 |1 is obsolete| | --- Comment #5 from Aleisha Amohia <aleishaamohia@hotmail.com> --- Created attachment 45796 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=45796&action=edit Bug 14480: Silences warn from editing patron To test: 1) Go to any patron (ie this link http://localhost:8081/cgi-bin/koha/members/moremember.pl?borrowernumber=1369) 2) Click Edit 3) Notice the warn appears 4) Apply patch and reload page 5) Notice warns are gone but page still works correctly 6) Add restriction and save, then go back to Edit 7) Confirm restriction shows as it should 8) Remove restriction and save, then go back to Edit 9) Confirm it says "Patron is currently unrestricted". -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- fatal: sha1 information is lacking or useless (koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- See comment 2 for the correct way to fix it. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 --- Comment #8 from Aleisha Amohia <aleishaamohia@hotmail.com> --- (In reply to Jonathan Druart from comment #7)
See comment 2 for the correct way to fix it.
Hi Jonathan, I made your change to [% IF ( debarments.size && debarments.size < 1 ) %] which does get rid of the warn, however it gives the same problem in Comment 4 where we see an empty table instead of the message. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 --- Comment #9 from Aleisha Amohia <aleishaamohia@hotmail.com> --- Sorry, I made the change to [% IF ( debarments && debarments.size < 1 ) %] -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #45796|0 |1 is obsolete| | --- Comment #10 from Aleisha Amohia <aleishaamohia@hotmail.com> --- Created attachment 46025 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46025&action=edit Bug 14480: Silences warn from editing patron To test: 1) Go to any patron (ie this link http://localhost:8081/cgi-bin/koha/members/moremember.pl?borrowernumber=1369) 2) Click Edit 3) Notice the warn appears 4) Apply patch and reload page 5) Notice warns are gone but page still works correctly 6) Add restriction and save, then go back to Edit 7) Confirm restriction shows as it should 8) Remove restriction and save, then go back to Edit 9) Confirm it says "Patron is currently unrestricted". -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 --- Comment #11 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Comment on attachment 46025 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46025 Bug 14480: Silences warn from editing patron Review of attachment 46025: --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=14480&attachment=46025) ----------------------------------------------------------------- ::: koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ +941,4 @@
<fieldset class="rows"> <legend>Patron restrictions</legend>
+ [% IF ( debarments.size = 'NULL' ) %]
I cannot explain why this works, but it's not the way to do :) size is a virtual method provided by Template::Toolkit, you cannot affect it the "NULL" string. Moreover you are using = instead of == Anyway, what I have proposed previously was the wrong test indeed, it should be [% UNLESS debarments %] -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtompset@hotmail.com --- Comment #12 from M. Tompsett <mtompset@hotmail.com> --- (In reply to Jonathan Druart from comment #11)
Anyway, what I have proposed previously was the wrong test indeed, it should be [% UNLESS debarments %]
Or clearer, swap the IF/ELSE. You know you are generating the table [% IF (debarments) %], [% ELSE %] you are putting out that other message. The advantage of Jonathan's suggestion is smaller patch size. The disadvantage is that the novice programmer does not usually think in negation logic. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 --- Comment #13 from M. Tompsett <mtompset@hotmail.com> --- (In reply to Aleisha Amohia from comment #9)
Sorry, I made the change to [% IF ( debarments && debarments.size < 1 ) %]
Actually, if you wanted to use an UGLY condition. [% IF ((! debarments) || (debarments && debarments.size<1)) %] But let's not go there. :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 --- Comment #14 from Aleisha Amohia <aleishaamohia@hotmail.com> --- I tried the UNLESS, and it was successful in clearing the warn but it gave us the empty table again, so decided to go with the IF/ELSE swap. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 --- Comment #15 from Aleisha Amohia <aleishaamohia@hotmail.com> --- Created attachment 46290 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46290&action=edit Bug 14480: Switching the IF/ELSE To test: 1) Go to any patron (ie this link http://localhost:8081/cgi-bin/koha/members/moremember.pl?borrowernumber=1369) 2) Click Edit 3) Notice the warn appears 4) Apply patch and reload page 5) Notice warns are gone but page still works correctly 6) Add restriction and save, then go back to Edit 7) Confirm restriction shows as it should 8) Remove restriction and save, then go back to Edit 9) Confirm it says "Patron is currently unrestricted". -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #46025|0 |1 is obsolete| | Attachment #46290|0 |1 is obsolete| | --- Comment #16 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 46300 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46300&action=edit Bug 14480: Silences warn from editing patron Argument "" isn't numeric in numeric lt (<) TEST PLAN --------- 1) Go to any patron in staff client 2) Click 'Edit' 3) Check error logs -- warnings should exist. 4) Apply patch 5) Reload page -- warnings should not be triggered. 6) Add restriction and save 7) Go back to edit screen -- restriction should be shown 8) Remove restriction and save 9) Go back to edit screen -- Should say "Patron is currently unrestricted" 10) Run koha qa test tools. NOTE: Squashed, because it is a really small set of patches and multiple commits does not make sense to me. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #46300|0 |1 is obsolete| | --- Comment #17 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 46301 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46301&action=edit Bug 14480: Silences warn from editing patron Argument "" isn't numeric in numeric lt (<) TEST PLAN --------- 1) Go to any patron in staff client 2) Click 'Edit' 3) Check error logs -- warnings should exist. 4) Apply patch 5) Reload page -- warnings should not be triggered. 6) Add restriction and save 7) Go back to edit screen -- restriction should be shown 8) Remove restriction and save 9) Go back to edit screen -- Should say "Patron is currently unrestricted" 10) Run koha qa test tools. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14480 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #46301|0 |1 is obsolete| | --- Comment #18 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 46305 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46305&action=edit Bug 14480: Silences warn from editing patron Argument "" isn't numeric in numeric lt (<) TEST PLAN --------- 1) Go to any patron in staff client 2) Click 'Edit' 3) Check error logs -- warnings should exist. 4) Apply patch 5) Reload page -- warnings should not be triggered. 6) Add restriction and save 7) Go back to edit screen -- restriction should be shown 8) Remove restriction and save 9) Go back to edit screen -- Should say "Patron is currently unrestricted" 10) Run koha qa test tools. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org