[Bug 34532] New: Silence warns in Patroncard.pm when layout values are empty
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34532 Bug ID: 34532 Summary: Silence warns in Patroncard.pm when layout values are empty Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Label/patron card printing Assignee: cnighswonger@foundations.edu Reporter: lucas@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org To recreate: 1. Go to patron card creator and make a patron card batch, card layout, and card template. 2. In the card layout leave some values blank for Lower left X coordinate and Lower left Y coordinate. 3. Now go create a card batch while tailing the plack-intranet-error log/ 4. Notice in the logs: [2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 109. [2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 248. [2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 249. The more patrons in a given batch the more of these errors you will see. If no llx or lly value is given we should assume it is 0. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34532 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34532 --- Comment #1 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 154415 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154415&action=edit Bug 34532: Silence warns in Patroncard.pm To test: 1. Go to patron card creator and make a patron card batch, card layout, and card template. 2. In the card layout leave some values blank for Lower left X coordinate and Lower left Y coordinate. 3. Now go create a card batch while tailing the plack-intranet-error log/ 4. Notice in the logs: [2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 109. [2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 248. [2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 249. 5. Apply patch, restart_all 6. Try again and notice the WARNS should be gone from the logs now. 7. Make sure you can still create patron cards and the PDF's the generate look right. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34532 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|cnighswonger@foundations.ed |lucas@bywatersolutions.com |u | Patch complexity|--- |Small patch Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34532 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154415|0 |1 is obsolete| | --- Comment #2 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 154416 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154416&action=edit Bug 34532: Silence warns in Patroncard.pm To test: 1. Go to patron card creator and make a patron card batch, card layout, and card template. 2. In the card layout leave some values blank for Lower left X coordinate and Lower left Y coordinate. 3. Now go create a card batch while tailing the plack-intranet-error log/ 4. Notice in the logs: [2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 109. [2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 248. [2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 249. 5. Apply patch, restart_all 6. Try again and notice the WARNS should be gone from the logs now. 7. Make sure you can still create patron cards and the PDF's the generate look right. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34532 Michael Adamyk <madamyk@ckls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |madamyk@ckls.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34532 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34532 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154416|0 |1 is obsolete| | --- Comment #3 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 154680 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154680&action=edit Bug 34532: Silence warns in Patroncard.pm To test: 1. Go to patron card creator and make a patron card batch, card layout, and card template. 2. In the card layout leave some values blank for Lower left X coordinate and Lower left Y coordinate. 3. Now go create a card batch while tailing the plack-intranet-error log/ 4. Notice in the logs: [2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 109. [2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 248. [2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 249. 5. Apply patch, restart_all 6. Try again and notice the WARNS should be gone from the logs now. 7. Make sure you can still create patron cards and the PDF's the generate look right. Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34532 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |m.de.rooy@rijksmuseum.nl --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Sorry (no tidy fan either): WARN tidiness The file is less tidy than before (bad/messy lines before: 175, now: 180) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34532 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154680|0 |1 is obsolete| | --- Comment #5 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 155119 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155119&action=edit Bug 34532: Silence warns in Patroncard.pm To test: 1. Go to patron card creator and make a patron card batch, card layout, and card template. 2. In the card layout leave some values blank for Lower left X coordinate and Lower left Y coordinate. 3. Now go create a card batch while tailing the plack-intranet-error log/ 4. Notice in the logs: [2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 109. [2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 248. [2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 249. 5. Apply patch, restart_all 6. Try again and notice the WARNS should be gone from the logs now. 7. Make sure you can still create patron cards and the PDF's the generate look right. Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34532 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34532 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net Status|Signed Off |Failed QA --- Comment #6 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Thanks Lucas, more extract variable refactoring :) Thanks Marcel to also look at this, I started to look at this yesterday and wondered if there was a reason to have the $llx & $lly default values set in the method instead of the constructor: https://git.koha-community.org/Koha-community/Koha/src/commit/e26d7c783eb8c7... Currently there are likely the same warns in the other functions if llx & lly are undef. And now I notice it's actually done twice, once in each method, so there is duplication. And one occurrence is `my $lly = $self->{'llx'} || 0;` which very likely should be $self->{'lly'} -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34532 --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- lly => $llx + $llx_layout * $self->{'unitvalue'}, Typo -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34532 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34532 --- Comment #8 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 155630 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155630&action=edit Bug 34532: (follow-up) Fix typos llx => lly -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34532 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34532 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #155119|0 |1 is obsolete| | Attachment #155630|0 |1 is obsolete| | --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 155638 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155638&action=edit Bug 34532: Silence warns in Patroncard.pm To test: 1. Go to patron card creator and make a patron card batch, card layout, and card template. 2. In the card layout leave some values blank for Lower left X coordinate and Lower left Y coordinate. 3. Now go create a card batch while tailing the plack-intranet-error log/ 4. Notice in the logs: [2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 109. [2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 248. [2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 249. 5. Apply patch, restart_all 6. Try again and notice the WARNS should be gone from the logs now. 7. Make sure you can still create patron cards and the PDF's the generate look right. Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34532 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | --- Comment #10 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Merged both patches -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34532 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |23.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34532 --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34532 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable CC| |fridolin.somers@biblibre.co | |m Version(s)|23.11.00 |23.11.00,23.05.04 released in| | --- Comment #12 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.05.x for 23.05.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34532 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable Version(s)|23.11.00,23.05.04 |23.11.00,23.05.04,22.11.11 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34532 --- Comment #13 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Nice work everyone! Pushed to oldstable for 22.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org