Bug 7862 - Warns when creating a new notice
Summary: Warns when creating a new notice
Status: Pushed to Stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Target Milestone: ---
Assignee: Aleisha Amohia
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-31 18:54 UTC by Katrin Fischer
Modified: 2019-05-30 07:09 UTC (History)
3 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
19.05.00, 18.11.06


Attachments
Bug 7862: Preventing warns when creating a notice (3.02 KB, patch)
2019-04-29 03:18 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 7862: Preventing warns when creating a notice (3.08 KB, patch)
2019-05-03 20:09 UTC, Maryse Simard
Details | Diff | Splinter Review
Bug 7862: Preventing warns when creating a notice (3.16 KB, patch)
2019-05-08 17:45 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2012-03-31 18:54:12 UTC
When creating a new notice (my example was All libraries - routing list) a lot of entries in the log are created:

[Sat Mar 31 20:51:52 2012] [error] [client 127.0.0.1] [Sat Mar 31 20:51:52 2012] letter.pl: Use of uninitialized value $module in string eq at /home/katrin/kohaclone/tools/letter.pl line 175., referer: http://localhost:8080/cgi-bin/koha/tools/letter.pl
[Sat Mar 31 20:51:52 2012] [error] [client 127.0.0.1] [Sat Mar 31 20:51:52 2012] letter.pl: Use of uninitialized value $module in string eq at /home/katrin/kohaclone/tools/letter.pl line 178., referer: http://localhost:8080/cgi-bin/koha/tools/letter.pl
[Sat Mar 31 20:51:52 2012] [error] [client 127.0.0.1] [Sat Mar 31 20:51:52 2012] letter.pl: Use of uninitialized value $module in string eq at /home/katrin/kohaclone/tools/letter.pl line 181., referer: http://localhost:8080/cgi-bin/koha/tools/letter.pl
[Sat Mar 31 20:51:52 2012] [error] [client 127.0.0.1] [Sat Mar 31 20:51:52 2012] letter.pl: Use of uninitialized value $module in string eq at /home/katrin/kohaclone/tools/letter.pl line 192., referer: http://localhost:8080/cgi-bin/koha/tools/letter.pl
[Sat Mar 31 20:51:52 2012] [error] [client 127.0.0.1] [Sat Mar 31 20:51:52 2012] letter.pl: Use of uninitialized value $module in string eq at /home/katrin/kohaclone/tools/letter.pl line 200., referer: http://localhost:8080/cgi-bin/koha/tools/letter.pl
[Sat Mar 31 20:51:52 2012] [error] [client 127.0.0.1] [Sat Mar 31 20:51:52 2012] letter.pl: Problem = a value of 1 has been passed to param without key at /home/katrin/kohaclone/C4/Templates.pm line 187., referer: http://localhost:8080/cgi-bin/koha/tools/letter.pl
Comment 1 Aleisha Amohia 2016-07-04 01:14:41 UTC
I don't believe this is still valid. Can you check?
Comment 2 Katrin Fischer 2019-04-28 17:58:53 UTC
These days they look a little different:

Use of uninitialized value $code in regexp compilation at /home/vagrant/kohaclone/tools/letter.pl line 263.
Use of uninitialized value $code in regexp compilation at /home/vagrant/kohaclone/tools/letter.pl line 263.
Use of uninitialized value $code in regexp compilation at /home/vagrant/kohaclone/tools/letter.pl line 263.
CGI::param called in list context from /home/vagrant/kohaclone/svc/letters/get line 50, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/share/perl5/CGI.pm line 412.
Comment 3 Aleisha Amohia 2019-04-29 03:18:30 UTC
Created attachment 88996 [details] [review]
Bug 7862: Preventing warns when creating a notice

To reproduce warns:
1) Go to Tools -> Notices & slips
2) Create a new notice of any module

Notice these warns:
Use of uninitialized value $code in regexp compilation at
/home/vagrant/kohaclone/tools/letter.pl line 265.
Use of uninitialized value $code in regexp compilation at
/home/vagrant/kohaclone/tools/letter.pl line 265.
Use of uninitialized value $code in regexp compilation at
/home/vagrant/kohaclone/tools/letter.pl line 265.

CGI::param called in list context from package
CGI::Compile::ROOT::home_vagrant_kohaclone_svc_letters_get line 50, this
can lead to vulnerabilities. See the warning in "Fetching the value or
values of a single named parameter" at /usr/share/perl5/CGI.pm line 436.
CGI::param called in list context from package
CGI::Compile::ROOT::home_vagrant_kohaclone_svc_letters_get line 50, this
can lead to vulnerabilities. See the warning in "Fetching the value or
values of a single named parameter" at /usr/share/perl5/CGI.pm line 436.

3) Create a new notice of the Circulation module

Notice this additional warn:
Use of uninitialized value $code in pattern match (m//) at
/home/vagrant/kohaclone/tools/letter.pl line 258.

To test:
4) Apply patch and refresh page
5) Run steps 1-3 again and confirm no warns show

Sponsored-by: Catalyst IT
Comment 4 Maryse Simard 2019-05-03 20:09:32 UTC
Created attachment 89329 [details] [review]
Bug 7862: Preventing warns when creating a notice

To reproduce warns:
1) Go to Tools -> Notices & slips
2) Create a new notice of any module

Notice these warns:
Use of uninitialized value $code in regexp compilation at
/home/vagrant/kohaclone/tools/letter.pl line 265.
Use of uninitialized value $code in regexp compilation at
/home/vagrant/kohaclone/tools/letter.pl line 265.
Use of uninitialized value $code in regexp compilation at
/home/vagrant/kohaclone/tools/letter.pl line 265.

CGI::param called in list context from package
CGI::Compile::ROOT::home_vagrant_kohaclone_svc_letters_get line 50, this
can lead to vulnerabilities. See the warning in "Fetching the value or
values of a single named parameter" at /usr/share/perl5/CGI.pm line 436.
CGI::param called in list context from package
CGI::Compile::ROOT::home_vagrant_kohaclone_svc_letters_get line 50, this
can lead to vulnerabilities. See the warning in "Fetching the value or
values of a single named parameter" at /usr/share/perl5/CGI.pm line 436.

3) Create a new notice of the Circulation module

Notice this additional warn:
Use of uninitialized value $code in pattern match (m//) at
/home/vagrant/kohaclone/tools/letter.pl line 258.

To test:
4) Apply patch and refresh page
5) Run steps 1-3 again and confirm no warns show

Sponsored-by: Catalyst IT
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 5 Jonathan Druart 2019-05-08 17:45:02 UTC
Created attachment 89478 [details] [review]
Bug 7862: Preventing warns when creating a notice

To reproduce warns:
1) Go to Tools -> Notices & slips
2) Create a new notice of any module

Notice these warns:
Use of uninitialized value $code in regexp compilation at
/home/vagrant/kohaclone/tools/letter.pl line 265.
Use of uninitialized value $code in regexp compilation at
/home/vagrant/kohaclone/tools/letter.pl line 265.
Use of uninitialized value $code in regexp compilation at
/home/vagrant/kohaclone/tools/letter.pl line 265.

CGI::param called in list context from package
CGI::Compile::ROOT::home_vagrant_kohaclone_svc_letters_get line 50, this
can lead to vulnerabilities. See the warning in "Fetching the value or
values of a single named parameter" at /usr/share/perl5/CGI.pm line 436.
CGI::param called in list context from package
CGI::Compile::ROOT::home_vagrant_kohaclone_svc_letters_get line 50, this
can lead to vulnerabilities. See the warning in "Fetching the value or
values of a single named parameter" at /usr/share/perl5/CGI.pm line 436.

3) Create a new notice of the Circulation module

Notice this additional warn:
Use of uninitialized value $code in pattern match (m//) at
/home/vagrant/kohaclone/tools/letter.pl line 258.

To test:
4) Apply patch and refresh page
5) Run steps 1-3 again and confirm no warns show

Sponsored-by: Catalyst IT
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Nick Clemens 2019-05-15 12:19:01 UTC
Awesome work all!

Pushed to master for 19.05
Comment 7 Martin Renvoize 2019-05-30 07:09:04 UTC
Pushed to 18.11.x for 18.11.06