Bug 2505 - Omnibus: Enable Perl warnings in all modules and scripts
Summary: Omnibus: Enable Perl warnings in all modules and scripts
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P1 - high minor (vote)
Assignee: Galen Charlton
QA Contact:
URL:
Keywords:
Depends on: 27481 27483 35423 19992 19993 19995 19996 19997 19998 20000 20009 20010 20011 20012 20013 20015 20016 20017 20018 20019 20020 24217 27482 27484
Blocks:
  Show dependency treegraph
 
Reported: 2008-08-11 07:28 UTC by Galen Charlton
Modified: 2023-12-30 20:34 UTC (History)
12 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Patch for opac-ISBDdetail.pl, opac-modrequest.pl and opac-tags_subject.pl (1.41 KB, patch)
2009-08-08 18:33 UTC, Chris Cormack
Details | Diff | Splinter Review
Patch for opac-serial-issues.pl and opac-showmarc.pl (1.37 KB, patch)
2009-08-09 17:42 UTC, Chris Cormack
Details | Diff | Splinter Review
Patch for opac-addbybiblionumber.pl and opac-alert-suscribe.pl (1.62 KB, patch)
2009-08-09 21:32 UTC, Chris Cormack
Details | Diff | Splinter Review
Patch for opac-userupdate.pl (2.77 KB, patch)
2009-08-12 00:45 UTC, Chris Cormack
Details | Diff | Splinter Review
Patch for opac-export.pl and opac-sendbasket.pl (948 bytes, patch)
2009-08-12 17:08 UTC, Chris Cormack
Details | Diff | Splinter Review
Patch for opac-passwd.pl and opac-renew.pl (1.39 KB, patch)
2009-08-12 18:06 UTC, Chris Cormack
Details | Diff | Splinter Review
Patch for opac-topissues.pl (5.97 KB, patch)
2009-08-14 00:25 UTC, Chris Cormack
Details | Diff | Splinter Review
Patch for reserveratios.pl (974 bytes, patch)
2009-08-20 23:27 UTC, Chris Cormack
Details | Diff | Splinter Review
Patch for admin/admin-home.pl and admin/roadtype.pl (2.56 KB, patch)
2009-09-01 23:13 UTC, Chris Cormack
Details | Diff | Splinter Review
Patch for members/boraccount.pl and members/pay.pl (1.67 KB, patch)
2009-09-04 15:57 UTC, Chris Cormack
Details | Diff | Splinter Review
Patch for tools-home.pl, holidays.pl, newHolidays.pl, and exceptionHolidays.pl (1.63 KB, patch)
2009-09-11 15:27 UTC, Chris Cormack
Details | Diff | Splinter Review
Patch for members/messaging.pl and members/readingrec.pl (1.52 KB, patch)
2009-09-21 23:24 UTC, Chris Cormack
Details | Diff | Splinter Review
Patch for members/patronimage.pl and setdebar.pl (1.61 KB, patch)
2009-09-22 23:19 UTC, Chris Cormack
Details | Diff | Splinter Review
Patch for members/setstatus.pl and members/members-home.pl (1.50 KB, patch)
2009-09-24 15:42 UTC, Chris Cormack
Details | Diff | Splinter Review
Patch for members/mancredit.pl and members/maninvoice.pl (1.72 KB, patch)
2009-09-24 17:13 UTC, Chris Cormack
Details | Diff | Splinter Review
Patch for member-flags.pl, member-password.pl, and member-picupload.pl (1.41 KB, patch)
2009-09-24 19:59 UTC, Chris Cormack
Details | Diff | Splinter Review
Patch for authorities scripts (10.61 KB, patch)
2009-10-02 11:24 UTC, Chris Cormack
Details | Diff | Splinter Review
Proposed patch for opac-readingrecord.pl (3.97 KB, patch)
2010-02-02 20:25 UTC, Chris Cormack
Details | Diff | Splinter Review
Proposed patch for opac/errors/400.pl, 401.pl, 402.pl, 403.pl, 404.pl and 500.pl (1.96 KB, patch)
2010-02-02 21:53 UTC, Chris Cormack
Details | Diff | Splinter Review
Proposed patch for opac-ics.pl and opac-search-history.pl (1.47 KB, patch)
2010-02-02 23:56 UTC, Chris Cormack
Details | Diff | Splinter Review
Proposed patch for matching-rules.pl (842 bytes, patch)
2010-02-11 02:15 UTC, Chris Cormack
Details | Diff | Splinter Review
Patch for opac-autoritiesdetail.pl and opac-MARCdetail.pl (1.07 KB, patch)
2010-02-15 22:12 UTC, Chris Cormack
Details | Diff | Splinter Review
Patch for opac-maintenance.pl (713 bytes, patch)
2010-02-17 23:08 UTC, Chris Cormack
Details | Diff | Splinter Review
Patch for opac-userdetails.pl (735 bytes, patch)
2010-02-19 01:08 UTC, Chris Cormack
Details | Diff | Splinter Review
Patch for admin/patron-attr-types.pl (937 bytes, patch)
2010-06-05 22:19 UTC, Garry Collum
Details | Diff | Splinter Review
Patch for tools/inventory.pl (3.22 KB, patch)
2011-04-11 18:47 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review
Supplementary patch (1.58 KB, patch)
2011-07-07 10:55 UTC, Colin Campbell
Details | Diff | Splinter Review
Bug 2505 - enable Perl warnings in all modules and scripts (3.24 KB, patch)
2012-03-15 08:14 UTC, Mason James
Details | Diff | Splinter Review
Bug 2505 : use warnings in smart_rules.pl (985 bytes, patch)
2012-03-19 22:56 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 2505 : Switch on warnings in circ/returns.pl (1.19 KB, patch)
2012-03-20 00:49 UTC, Chris Cormack
Details | Diff | Splinter Review
parcel table : needs value of tax not tax rate (169.15 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2012-03-20 17:01 UTC, Koha Team University Lyon 3
Details
Bug 2505 - enable Perl warnings in all modules and scripts (3.22 KB, patch)
2012-04-09 07:30 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 2505 : use warnings in smart_rules.pl (1.02 KB, patch)
2012-04-09 07:32 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 2505 : Switch on warnings in circ/returns.pl (1.24 KB, patch)
2012-04-09 07:34 UTC, Chris Cormack
Details | Diff | Splinter Review
Update to C4::Ris.pm (15.06 KB, patch)
2014-12-15 21:52 UTC, Andrew Maguire
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cormack 2010-05-21 00:51:56 UTC


---- Reported by gmcharlt@gmail.com 2008-08-11 19:28:26 ----

The warnings pragma (i.e., 'use warnings;') should be enabled in all Perl scripts and modules.

This is a catch-all bug for all patches to enable warnings.  When enabling warnings for a script and module, every warning message reported to STDERR should be quelled by fixing the underlying problem.  When turning on warnings for a module, it would be nice to add test cases as well.



---- Additional Comments From Andrew.moore@liblime.com 2008-12-17 14:39:50 ----

I submitted a few patches to turn on warnings in files that I'm working on for http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=2797:

* C4::Biblio: http://markmail.org/message/vw4nfoidiy7keqfw
* catalogue/detail.pl: http://markmail.org/message/nhzkwlaymoqgkiav
* opac/opac-detail.pl: http://markmail.org/message/ayn5ipgsdzselysh





---- Additional Comments From chris@bigballofwax.co.nz 2009-04-25 04:47:54 ----

I have just done
opac/opac-main.pl
opac/opac-search.pl



---- Additional Comments From gcollum@gmail.com 2009-08-08 18:33:25 ----

Created an attachment
Patch for opac-ISBDdetail.pl, opac-modrequest.pl and opac-tags_subject.pl





---- Additional Comments From gcollum@gmail.com 2009-08-09 17:42:23 ----

Created an attachment
Patch for opac-serial-issues.pl and opac-showmarc.pl





---- Additional Comments From gcollum@gmail.com 2009-08-09 21:32:11 ----

Created an attachment
Patch for opac-addbybiblionumber.pl and opac-alert-suscribe.pl





---- Additional Comments From gcollum@gmail.com 2009-08-12 00:45:05 ----

Created an attachment
Patch for opac-userupdate.pl





---- Additional Comments From gcollum@gmail.com 2009-08-12 17:08:46 ----

Created an attachment
Patch for opac-export.pl and opac-sendbasket.pl





---- Additional Comments From gcollum@gmail.com 2009-08-12 18:06:30 ----

Created an attachment
Patch for opac-passwd.pl and opac-renew.pl





---- Additional Comments From gcollum@gmail.com 2009-08-14 00:25:37 ----

Created an attachment
Patch for opac-topissues.pl





---- Additional Comments From gcollum@gmail.com 2009-08-20 23:27:35 ----

Created an attachment
Patch for reserveratios.pl





---- Additional Comments From gcollum@gmail.com 2009-09-01 23:13:46 ----

Created an attachment
Patch for admin/admin-home.pl and admin/roadtype.pl





---- Additional Comments From gcollum@gmail.com 2009-09-04 15:57:50 ----

Created an attachment
Patch for members/boraccount.pl and members/pay.pl





---- Additional Comments From gcollum@gmail.com 2009-09-11 15:27:16 ----

Created an attachment
Patch for tools-home.pl, holidays.pl, newHolidays.pl, and exceptionHolidays.pl





---- Additional Comments From gcollum@gmail.com 2009-09-21 23:24:02 ----

Created an attachment
Patch for members/messaging.pl and members/readingrec.pl





---- Additional Comments From gcollum@gmail.com 2009-09-22 23:19:15 ----

Created an attachment
Patch for members/patronimage.pl and setdebar.pl





---- Additional Comments From gcollum@gmail.com 2009-09-24 15:42:45 ----

Created an attachment
Patch for members/setstatus.pl and members/members-home.pl





---- Additional Comments From gcollum@gmail.com 2009-09-24 17:13:50 ----

Created an attachment
Patch for members/mancredit.pl and members/maninvoice.pl





---- Additional Comments From gcollum@gmail.com 2009-09-24 19:59:43 ----

Created an attachment
Patch for member-flags.pl, member-password.pl, and member-picupload.pl





---- Additional Comments From colin.campbell@ptfs-europe.com 2009-10-02 11:24:55 ----

Created an attachment
Patch for authorities scripts





---- Additional Comments From chris@bigballofwax.co.nz 2009-12-12 09:48:56 ----

about.pl
mainpage.pl
acqui/acqui-home.pl 
done



---- Additional Comments From gcollum@gmail.com 2010-02-02 20:25:58 ----

Created an attachment
Proposed patch for opac-readingrecord.pl





---- Additional Comments From gcollum@gmail.com 2010-02-02 21:53:20 ----

Created an attachment
Proposed patch for opac/errors/400.pl, 401.pl, 402.pl, 403.pl, 404.pl and 500.pl





---- Additional Comments From gcollum@gmail.com 2010-02-02 23:56:04 ----

Created an attachment
Proposed patch for opac-ics.pl and opac-search-history.pl





---- Additional Comments From gcollum@gmail.com 2010-02-11 02:15:29 ----

Created an attachment
Proposed patch for matching-rules.pl





---- Additional Comments From gmcharlt@gmail.com 2010-02-11 20:43:52 ----

Moving back to head and changing severity to 'critical'.  This is important, but realistically is not going to be done in time for 3.2.



---- Additional Comments From gcollum@gmail.com 2010-02-15 22:12:13 ----

Created an attachment
Patch for opac-autoritiesdetail.pl and opac-MARCdetail.pl





---- Additional Comments From gcollum@gmail.com 2010-02-17 23:08:12 ----

Created an attachment
Patch for opac-maintenance.pl





---- Additional Comments From gcollum@gmail.com 2010-02-19 01:08:36 ----

Created an attachment
Patch for opac-userdetails.pl

opac directory only lacks changelanguage.pl and opac-user.pl



---- Additional Comments From koha@gamma.net.nz 2010-02-24 10:36:06 ----

Just letting people know I am currently working on this bug.

My first step is to add this line to files that are missing use warnings:

#use warnings; FIXME - http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=2505

as i dont currently have a test environment to fix all the warnings.

This will make it easy however to find all the places where this needs fixing by doing:

$ grep -rl 'http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=2505' *

I also changed -w to use warnings





--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 00:51 UTC  ---

This bug was previously known as _bug_ 2505 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=2505
Imported an attachment (id=686)
Imported an attachment (id=687)
Imported an attachment (id=688)
Imported an attachment (id=689)
Imported an attachment (id=690)
Imported an attachment (id=691)
Imported an attachment (id=692)
Imported an attachment (id=693)
Imported an attachment (id=694)
Imported an attachment (id=695)
Imported an attachment (id=696)
Imported an attachment (id=697)
Imported an attachment (id=698)
Imported an attachment (id=699)
Imported an attachment (id=700)
Imported an attachment (id=701)
Imported an attachment (id=702)
Imported an attachment (id=703)
Imported an attachment (id=704)
Imported an attachment (id=705)
Imported an attachment (id=706)
Imported an attachment (id=707)
Imported an attachment (id=708)
Imported an attachment (id=709)

Actual time not defined. Setting to 0.0
CC member koha@gamma.net.nz does not have an account here
The original submitter of attachment 686 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 687 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 688 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 689 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 690 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 691 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 692 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 693 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 694 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 695 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 696 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 697 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 698 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 699 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 700 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 701 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 702 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 703 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 704 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 705 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 706 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 707 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 708 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.
The original submitter of attachment 709 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.

Comment 1 Garry Collum 2010-06-05 22:19:15 UTC Comment hidden (obsolete)
Comment 2 Jared Camins-Esakov 2011-04-11 18:47:40 UTC Comment hidden (obsolete)
Comment 3 Jared Camins-Esakov 2011-04-11 18:48:31 UTC
So far as I can tell, the last patch (for tools/inventory.pl) is the only one requiring sign-off.
Comment 4 Chris Cormack 2011-04-11 21:58:19 UTC
Latest patch pushed
Comment 5 Colin Campbell 2011-07-07 10:55:04 UTC Comment hidden (obsolete)
Comment 6 Colin Campbell 2011-07-07 10:58:00 UTC
Resubmitted a patch from Jan. Turning on warnings causes a lot of messages due undefined branch and selected variables in members-home. This patch removes the cause of those "false positives"
Comment 7 Chris Cormack 2011-07-11 09:06:42 UTC
Patch easily tested, doesn't change functionality just quiets warns. Pushed.
Comment 8 Jared Camins-Esakov 2011-07-14 15:57:50 UTC
The following .pl and .pm files are still missing the use warnings directive:
C4/SIP/xmlparse.pl
acqui/check_budget_total.pl
acqui/fetch_sort_dropbox.pl
acqui/histsearch.pl
acqui/neworderbiblio.pl
acqui/newordersuggestion.pl
acqui/orderreceive.pl
acqui/parcel.pl
acqui/updatesupplier.pl
admin/aqbudget_owner_search.pl
admin/aqbudgetperiods.pl
admin/aqbudgets.pl
admin/aqplan.pl
admin/auth_subfields_structure.pl
admin/auth_tag_structure.pl
admin/categorie.pl
admin/check_budget_parent.pl
admin/check_parent_total.pl
admin/checkmarc.pl
admin/classsources.pl
admin/clone-rules.pl
admin/itemtypes.pl
admin/marc_subfields_structure.pl
admin/printers.pl
admin/smart-rules.pl
admin/z3950servers.pl
catalogue/ISBDdetail.pl
catalogue/MARCdetail.pl
catalogue/cardview.pl
catalogue/detailprint.pl
catalogue/export.pl
catalogue/issuehistory.pl
catalogue/moredetail.pl
catalogue/search.pl
catalogue/showmarc.pl
cataloguing/addbiblio.pl
cataloguing/additem.pl
cataloguing/merge.pl
cataloguing/merge_ajax.pl
cataloguing/moveitem.pl
cataloguing/plugin_launcher.pl
[all the files in cataloguing/value_builder]
cataloguing/ysearch.pl
cataloguing/z3950_search.pl
circ/bookcount.pl
circ/branchoverdues.pl
circ/circulation-home.pl
circ/circulation.pl
circ/hold-transfer-slip.pl
circ/pendingreserves.pl
circ/returns.pl
circ/stats.pl
circ/ysearch.pl
install-CPAN.pl
installer/data/mysql/atomicupdate/subscription_add_enddate.pl
installer/data/mysql/labels_upgrade.pl
installer/data/mysql/patroncards_upgrade.pl
installer/data/mysql/update22to30.pl
kohaversion.pl
members/deletemem.pl
members/guarantor_search.pl
members/member.pl
members/moremember.pl
members/notices.pl
members/update-child.pl
misc/batchCompareMARCvsFrameworks.pl
misc/batchDeleteUnusedSubfields.pl
misc/batchImportMARCWithBiblionumbers.pl
misc/batchRebuildBiblioTables.pl
misc/batchupdateISBNs.pl
misc/bin/zebraqueue_daemon.pl
misc/commit_biblios_file.pl
misc/cronjobs/build_browser_and_cloud.pl
misc/cronjobs/fines.pl
misc/cronjobs/holds/cancel_expired_holds.pl
misc/cronjobs/j2a.pl
misc/cronjobs/notifyMailsOp.pl
misc/cronjobs/smsoverdues.pl
misc/cronjobs/zebraqueue_start.pl
misc/exportauth.pl
misc/kohalib.pl
misc/migration_tools/22_to_30/export_Authorities.pl
misc/migration_tools/22_to_30/export_Authorities_xml.pl
misc/migration_tools/22_to_30/missing090field.pl
misc/migration_tools/22_to_30/move_marc_to_authheader.pl
misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl
misc/migration_tools/22_to_30/rebuild_leader.pl
misc/migration_tools/22_to_30/rebuild_unimarc_100.pl
misc/migration_tools/build6xx.pl
misc/migration_tools/buildCOUNTRY.pl
misc/migration_tools/buildEDITORS.pl
misc/migration_tools/buildLANG.pl
misc/migration_tools/bulkauthimport.pl
misc/migration_tools/fix_onloan.pl
misc/migration_tools/merge_authority.pl
misc/migration_tools/rebuild_nozebra.pl
misc/migration_tools/rebuild_zebra.pl
misc/migration_tools/upgradeitems.pl
misc/stage_biblios_file.pl
misc/translator/stats.pl
misc/translator/text-extract.pl
misc/translator/text-extract2.pl
misc/translator/tmpl_process3.pl
opac/changelanguage.pl
opac/opac-privacy.pl
opac/opac-user.pl
reports/acquisitions_stats.pl
reports/bor_issues_top.pl
reports/borrowers_stats.pl
reports/cat_issues_top.pl
reports/catalogue_stats.pl
reports/guided_reports.pl
reports/issues_avg_stats.pl
reports/issues_stats.pl
reports/manager.pl
reports/reports-home.pl
reports/reservereport.pl
reports/reserves_stats.pl
reports/stats.print.pl
reports/stats.screen.pl
resetversion.pl
rotating_collections/addItems.pl
rotating_collections/editCollections.pl
rotating_collections/rotatingCollections.pl
rotating_collections/transferCollection.pl
sms/sms.pl
sms/sms_listen_windows_start.pl
suggestion/suggestion.pl
test/search.pl
tools/background-job-progress.pl
tools/batchMod.pl
tools/cleanborrowers.pl
tools/csv-profiles.pl
tools/koha-news.pl
tools/pdfViewer.pl
tools/picture-upload.pl
tools/scheduler.pl
tools/stage-marc-import.pl
tools/upload-file-progress.pl
tools/upload-file.pl
tools/viewlog.pl
virtualshelves/addbybiblionumber.pl
Comment 9 Mason James 2012-03-15 08:14:21 UTC Comment hidden (obsolete)
Comment 10 Mason James 2012-03-15 08:45:04 UTC
(In reply to comment #8)
> The following .pl and .pm files are still missing the use warnings directive:
> C4/SIP/xmlparse.pl
> acqui/check_budget_total.pl
> acqui/fetch_sort_dropbox.pl
...

heya Jared,
out of curiosity - whats the command or script used to generate this list?
Comment 11 Chris Cormack 2012-03-19 22:56:25 UTC Comment hidden (obsolete)
Comment 12 Chris Cormack 2012-03-20 00:49:15 UTC Comment hidden (obsolete)
Comment 13 Koha Team University Lyon 3 2012-03-20 17:01:15 UTC Comment hidden (obsolete)
Comment 14 Chris Cormack 2012-04-09 07:30:42 UTC Comment hidden (obsolete)
Comment 15 Chris Cormack 2012-04-09 07:32:42 UTC Comment hidden (obsolete)
Comment 16 Chris Cormack 2012-04-09 07:34:17 UTC Comment hidden (obsolete)
Comment 17 Ian Walls 2012-04-09 18:39:53 UTC
All three attached files properly fix code for using warnings.  First patch adds 'my' to variables in foreach loops, and fixes some spacing.  Second patch corrects call to CGI (CGI->new(); instead of new CGI;).  Third patch breaks out default value of variable onto a second line with ||=.

Marking Passed QA.
Comment 18 Paul Poulain 2012-04-10 09:30:57 UTC
Comment on attachment 9034 [details] [review]
Bug 2505 - enable Perl warnings in all modules and scripts

This patch has been pushed
Comment 19 Paul Poulain 2012-04-10 09:31:02 UTC
Comment on attachment 9035 [details] [review]
Bug 2505 : use warnings in smart_rules.pl

This patch has been pushed
Comment 20 Paul Poulain 2012-04-10 09:31:07 UTC
Comment on attachment 9036 [details] [review]
Bug 2505 : Switch on warnings in circ/returns.pl

This patch has been pushed
Comment 21 Paul Poulain 2012-04-10 09:31:54 UTC
3 patches pushed, nothing waiting now, switching back to "assigned"
Comment 22 Paul Poulain 2012-04-10 13:13:39 UTC
I've removed the use strict use warnings for C4/Ris.pm, because the script is not strict compliant and jenkins report a lot of problems:
Global symbol "$utf" requires explicit package name at C4/Ris.pm line 111.
Global symbol "$intype" requires explicit package name at C4/Ris.pm line 350.
Global symbol "$intype" requires explicit package name at C4/Ris.pm line 350.
Global symbol "$intype" requires explicit package name at C4/Ris.pm line 353.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 363.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 389.
Global symbol "$intype" requires explicit package name at C4/Ris.pm line 431.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 438.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 439.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 440.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 441.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 442.
Global symbol "$intype" requires explicit package name at C4/Ris.pm line 443.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 464.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 465.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 466.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 479.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 480.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 483.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 484.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 485.
Global symbol "$intype" requires explicit package name at C4/Ris.pm line 501.
Global symbol "$intype" requires explicit package name at C4/Ris.pm line 505.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 527.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 530.
Global symbol "$intype" requires explicit package name at C4/Ris.pm line 539.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 540.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 556.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 557.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 561.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 562.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 578.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 579.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 583.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 584.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 613.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 614.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 629.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 630.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 645.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 646.
Global symbol "$intype" requires explicit package name at C4/Ris.pm line 674.
Global symbol "$protoyear" requires explicit package name at C4/Ris.pm line 706.
Global symbol "$protoyear" requires explicit package name at C4/Ris.pm line 707.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 707.
Global symbol "$protoyear" requires explicit package name at C4/Ris.pm line 710.
Global symbol "$protoyear" requires explicit package name at C4/Ris.pm line 715.
Global symbol "$protoyear" requires explicit package name at C4/Ris.pm line 721.
Global symbol "$protoyear" requires explicit package name at C4/Ris.pm line 725.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 729.
Global symbol "$protoyear" requires explicit package name at C4/Ris.pm line 730.
Global symbol "$protoyear" requires explicit package name at C4/Ris.pm line 730.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 731.
Global symbol "$protoyear" requires explicit package name at C4/Ris.pm line 734.
Global symbol "$protoyear" requires explicit package name at C4/Ris.pm line 735.
Global symbol "$protoyear" requires explicit package name at C4/Ris.pm line 738.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 772.
Global symbol "@kwsubfields" requires explicit package name at C4/Ris.pm line 776.
Global symbol "@kwsubfields" requires explicit package name at C4/Ris.pm line 779.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 789.
Global symbol "@notesubfields" requires explicit package name at C4/Ris.pm line 892.
Global symbol "@notesubfields" requires explicit package name at C4/Ris.pm line 895.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 901.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 935.
Global symbol "$utf" requires explicit package name at C4/Ris.pm line 962.
Global symbol "$uniout" requires explicit package name at C4/Ris.pm line 966.
C4/Ris.pm had compilation errors.


(just commented the 2 lines, not reverted the whole patch = what is done is correct, but there are things missing)
Comment 23 Andrew Maguire 2014-12-15 21:52:46 UTC Comment hidden (obsolete)
Comment 24 Paul Poulain 2014-12-24 09:30:10 UTC
(In reply to Andrew Maguire from comment #23)
> During testing, discovered the charconv() function is a no-op, so I wondered
> what
> should happen if database is in MARC8 (non-UTF) format.

Hi Andrew,

Can this happen ? unless I misunderstand something, Koha transform MARC8 into UTF when importing, so in the database, you should have only UTF records.
Comment 25 Katrin Fischer 2015-06-06 19:00:41 UTC
I agree with Paul - the database should never be in MARC8, if your database is not in UTF-8, you got another problem.

How can we continue here? The available patch does no longer apply.
Comment 26 Jonathan Druart 2016-03-04 09:47:11 UTC
Modern::Perl is used in C4::Ris since bug 12357.
Comment 27 Katrin Fischer 2018-02-04 14:51:50 UTC
This bug hasn't seen much attention for a few years now. During the Open Source Academy 2018 the students switched a lot (all?) scripts over to use Modern::Perl; instead of the separate use strict; use warnings; pragmas.

I think by not using use warnings; in those scripts, we have possibly been hiding problems and switching it on globally might now be the way to go. We can keep an eye on the logs as we are still rather early in the release cycle and keep fixing warns as we find them.
Comment 28 Jonathan Druart 2018-02-05 12:27:09 UTC
(In reply to Katrin Fischer from comment #27)
> This bug hasn't seen much attention for a few years now. During the Open
> Source Academy 2018 the students switched a lot (all?) scripts over to use
> Modern::Perl; instead of the separate use strict; use warnings; pragmas.

Nope, still few left.
Comment 29 Barton Chittenden 2018-04-17 14:04:36 UTC
Just to see what happens, I enabled warnings in C4/Reserves.pm. All of the warnings were of the form

Subroutine * redefined at C4/Reserves.pm line *.

This is happening because of circular dependencies, e.g. 


C4/Reserves.pm uses

C4::Members
C4::Circulation

Those modules in turn use C4::Reserves. None of the functions used in these modules is actually called in C4::Reserves, but removing the calls to C4::Members and C4::Circulation from C4/Reserves.pm isn't enough, apparently there's a deeper circular dependency there.

I suspect that there are a number of unnecessary 'use' statements peppered throughout the C4 namespace; cleaning those up might fix the problem entirely, or at least allow us to resolve any remaining dependencies easily.
Comment 30 Aleisha Amohia 2018-12-20 01:16:43 UTC
Another Academy coming up... where else would we like students to make this change?
Comment 31 Jonathan Druart 2019-12-11 12:05:34 UTC
After bug 24217, this will no longer be a major.
Comment 32 Martin Renvoize 2020-06-26 10:17:36 UTC
Whats the current state of this one?
Comment 33 Jonathan Druart 2020-06-29 10:10:46 UTC
(In reply to Martin Renvoize from comment #32)
> Whats the current state of this one?

Still some left, but minor now:

% git grep -l 2505|grep -v '.md\|.html\|.txt'
cataloguing/value_builder/unimarc_field_105.pl
cataloguing/value_builder/unimarc_field_110.pl
cataloguing/value_builder/unimarc_field_120.pl
cataloguing/value_builder/unimarc_field_130.pl
cataloguing/value_builder/unimarc_field_140.pl
cataloguing/value_builder/unimarc_field_225a.pl
cataloguing/value_builder/unimarc_field_4XX.pl
koha-tmpl/intranet-tmpl/lib/linters/jshint.js
koha-tmpl/intranet-tmpl/lib/linters/jshint.min.js
koha-tmpl/opac-tmpl/lib/verovio/verovio-toolkit.js
misc/batchCompareMARCvsFrameworks.pl
misc/batchDeleteUnusedSubfields.pl
misc/batchImportMARCWithBiblionumbers.pl
misc/batchRebuildBiblioTables.pl
misc/cronjobs/build_browser_and_cloud.pl
misc/exportauth.pl
misc/kohalib.pl
misc/migration_tools/22_to_30/missing090field.pl
misc/migration_tools/22_to_30/move_marc_to_authheader.pl
misc/migration_tools/22_to_30/rebuild_leader.pl
misc/migration_tools/22_to_30/rebuild_unimarc_100.pl
misc/migration_tools/buildCOUNTRY.pl
misc/migration_tools/buildEDITORS.pl
misc/migration_tools/buildLANG.pl
misc/migration_tools/create_analytical_rel.pl
misc/migration_tools/upgradeitems.pl
misc/translator/tmpl_process3.pl
t/db_dependent/Biblio/TransformHtmlToMarc.t
t/db_dependent/data/marc21/zebraexport/biblio/exported_records
Comment 34 Jonathan Druart 2020-06-29 10:11:08 UTC
(should have excluded .js as well)