Summary: | Noisy warns in Notices (letter.tt) module | ||
---|---|---|---|
Product: | Koha | Reporter: | Aleisha Amohia <aleisha> |
Component: | Tools | Assignee: | Aleisha Amohia <aleisha> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | CC: | chris, indradg, jonathan.druart, kyle, mtj, tomascohen, wizzyrea |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 14445: Silences warn in letter.pl
Bug 14445: Silences warns in letter.tt Bug 14445: Silences warn in letter.pl Bug 14445: Silences warns in letter.tt [PASSED QA] Bug 14445: Silences warn in letter.pl [PASSED QA] Bug 14445: Silences warns in letter.tt |
Description
Aleisha Amohia
2015-06-24 03:51:35 UTC
(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 Created attachment 40545 [details] [review] 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 Created attachment 40743 [details] [review] 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 $code //= ''; should be put at the beginning of the subroutine, not right in the middle :) Comment on attachment 40743 [details] [review] Bug 14445: Silences warns in letter.tt Review of attachment 40743 [details] [review]: ----------------------------------------------------------------- ::: 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" (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? Created attachment 40856 [details] [review] 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> Created attachment 40857 [details] [review] 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> (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. Created attachment 40922 [details] [review] [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> Created attachment 40923 [details] [review] [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> Patches pushed to master. Thanks Aleisha! Pushed to 3.20.x will be in 3.20.3 Pushed to 3.18.x, will be in 3.18.10. Pushed to 3.16.x, will be in 3.16.14 |