[Bug 14445] New: Noisy warns in Notices (letter.tt) module
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14445 Bug ID: 14445 Summary: Noisy warns in Notices (letter.tt) module Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Tools Assignee: gmcharlt@gmail.com Reporter: aleishaamohia@hotmail.com QA Contact: testopia@bugs.koha-community.org A few noisy warns in koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt: In staff interface, go to Tools, then Notices & Slips Error: Click 'new notice' --> Argument "" isn't numeric in numeric gt (>) at line 400 Error: Change Koha module any other module --> same error Error: Change Koha module to 'Circulation' --> same error, and use of uninitialized value $code in string eq at line 230 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14445 --- Comment #1 from Aleisha Amohia <aleishaamohia@hotmail.com> --- (In reply to Aleisha Amohia from comment #0)
Error: Change Koha module to 'Circulation' --> same error, and use of uninitialized value $code in string eq at line 230
my mistake, this error is actually in tools/letter.pl -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14445 --- Comment #2 from Aleisha Amohia <aleishaamohia@hotmail.com> --- Created attachment 40545 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40545&action=edit Bug 14445: Silences warn in letter.pl When changing Koha module to 'Circulation', there is a warn saying that $code is uninitialized. This patch sets $code to an empty string to silence the warn. To test: 1) Go to Tools, the Notices & Slips 2) Click 'new notice' (This will trigger warns, but ignore these as they will be corrected in the next patch) 3) Change Koha module to 'Circulation' 4) Notice warn about uninitialized $code variable 5) Apply patch and reload page, change Koha module to 'Circulation' 6) Notice page still works and warns are gone -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14445 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.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14445 --- Comment #3 from Aleisha Amohia <aleishaamohia@hotmail.com> --- Created attachment 40743 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40743&action=edit Bug 14445: Silences warns in letter.tt When creating a new notice, warn is triggered "Argument "" isn't numeric in numeric gt (>) at line 400". Same warn is triggered when changing Koha module option to any other module. To test: 1) Go to Tools, then Notices & Slips 2) Click 'new notice'. Notice warn in intranet-error.log 3) Change Koha module to another module. Notice warn is triggered for every change 4) Apply patch and reload page 5) Change Koha module to another module. Notice there are no longer warns 6) Go back to Notices & Slips and click 'new notice' again. Notice there are no warns -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14445 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |aleishaamohia@hotmail.com Severity|enhancement |minor CC| |jonathan.druart@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14445 --- Comment #4 from Jonathan Druart <jonathan.druart@biblibre.com> --- $code //= ''; should be put at the beginning of the subroutine, not right in the middle :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14445 --- Comment #5 from Jonathan Druart <jonathan.druart@biblibre.com> --- Comment on attachment 40743 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40743 Bug 14445: Silences warns in letter.tt Review of attachment 40743: --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=14445&attachment=40743) ----------------------------------------------------------------- ::: koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt @@ +397,4 @@
<li> <label for="SQLfieldname_[% letter.message_transport_type %]">Message body:</label> [% IF letter.message_transport_type == 'sms' %] + <span id="sms_counter">[% IF letter.length && letter.length > 0 %][% letter.length %][% ELSE %]0[% END %]/160 characters</span>
This is wrong, we want to display the length of the content. With your patch, the string displayed is always "Message body: 0/160 characters" -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14445 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=14445 --- Comment #6 from Aleisha Amohia <aleishaamohia@hotmail.com> --- (In reply to Jonathan Druart from comment #5)
This is wrong, we want to display the length of the content. With your patch, the string displayed is always "Message body: 0/160 characters"
Hi Jonathan, this tests correctly for me, but do you know a better way to silence this warn? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14445 Indranil Das Gupta <indradg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |indradg@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14445 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14445 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40545|0 |1 is obsolete| | Attachment #40743|0 |1 is obsolete| | --- Comment #7 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 40856 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40856&action=edit Bug 14445: Silences warn in letter.pl When changing Koha module to 'Circulation', there is a warn saying that $code is uninitialized. This patch sets $code to an empty string to silence the warn. To test: 1) Go to Tools, the Notices & Slips 2) Click 'new notice' (This will trigger warns, but ignore these as they will be corrected in the next patch) 3) Change Koha module to 'Circulation' 4) Notice warn about uninitialized $code variable 5) Apply patch and reload page, change Koha module to 'Circulation' 6) Notice page still works and warns are gone Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14445 --- Comment #8 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 40857 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40857&action=edit Bug 14445: Silences warns in letter.tt When creating a new notice, warn is triggered "Argument "" isn't numeric in numeric gt (>) at line 400". Same warn is triggered when changing Koha module option to any other module. To test: 1) Go to Tools, then Notices & Slips 2) Click 'new notice'. Notice warn in intranet-error.log 3) Change Koha module to another module. Notice warn is triggered for every change 4) Apply patch and reload page 5) Change Koha module to another module. Notice there are no longer warns 6) Go back to Notices & Slips and click 'new notice' again. Notice there are no warns Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14445 --- Comment #9 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Aleisha Amohia from comment #6)
(In reply to Jonathan Druart from comment #5)
This is wrong, we want to display the length of the content. With your patch, the string displayed is always "Message body: 0/160 characters"
Hi Jonathan, this tests correctly for me, but do you know a better way to silence this warn?
You should have used letter.content.length. I have amended your 2 patches, please have a look. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14445 Kyle M Hall <kyle@bywatersolutions.com> 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=14445 --- Comment #10 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 40922 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40922&action=edit [PASSED QA] Bug 14445: Silences warn in letter.pl When changing Koha module to 'Circulation', there is a warn saying that $code is uninitialized. This patch sets $code to an empty string to silence the warn. To test: 1) Go to Tools, the Notices & Slips 2) Click 'new notice' (This will trigger warns, but ignore these as they will be corrected in the next patch) 3) Change Koha module to 'Circulation' 4) Notice warn about uninitialized $code variable 5) Apply patch and reload page, change Koha module to 'Circulation' 6) Notice page still works and warns are gone Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14445 --- Comment #11 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 40923 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40923&action=edit [PASSED QA] Bug 14445: Silences warns in letter.tt When creating a new notice, warn is triggered "Argument "" isn't numeric in numeric gt (>) at line 400". Same warn is triggered when changing Koha module option to any other module. To test: 1) Go to Tools, then Notices & Slips 2) Click 'new notice'. Notice warn in intranet-error.log 3) Change Koha module to another module. Notice warn is triggered for every change 4) Apply patch and reload page 5) Change Koha module to another module. Notice there are no longer warns 6) Go back to Notices & Slips and click 'new notice' again. Notice there are no warns Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14445 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Attachment #40856|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14445 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40857|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14445 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |tomascohen@gmail.com --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patches pushed to master. Thanks Aleisha! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14445 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |chris@bigballofwax.co.nz --- Comment #13 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.20.x will be in 3.20.3 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14445 Liz Rea <wizzyrea@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wizzyrea@gmail.com --- Comment #14 from Liz Rea <wizzyrea@gmail.com> --- Pushed to 3.18.x, will be in 3.18.10. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14445 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com --- Comment #15 from Mason James <mtj@kohaaloha.com> --- Pushed to 3.16.x, will be in 3.16.14 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org