From 6ec1ca154cbcad9b2db7cacabe806936fce02465 Mon Sep 17 00:00:00 2001 From: Charlotte Cordwell Date: Wed, 17 Jan 2018 20:46:59 +0000 Subject: [PATCH] Bug 19991: use Modern::Perl in OPAC perl scripts Test Case: Check the following files have been updated from use strict; use warnings; to use Modern::Perl; errors/400.pl errors/401.pl errors/402.pl errors/403.pl errors/404.pl errors/500.pl opac-account-pay-paypal-return.pl opac-alert-subscribe.pl opac-authorities-home.pl opac-authoritiesdetail.pl opac-browser.pl opac-ics.pl opac-image.pl opac-imageviewer.pl opac-messaging.pl opac-modrequest-suspend.pl opac-modrequest.pl opac-mymessages.pl opac-overdrive-search.pl opac-passwd.pl opac-patron-image.pl opac-privacy.pl opac-ratings-ajax.pl opac-ratings.pl opac-readingrecord.pl opac-renew.pl opac-sendshelf.pl opac-serial-issues.pl opac-showreviews.pl opac-suggestions.pl opac-tags_subject.pl opac-topissues.pl opac-user.pl sco/help.pl sco/printslip.pl sco/sco-patron-image.pl svc/overdrive_proxy svc/suggestion unapi Signed-off-by: Maryse Simard Signed-off-by: Jonathan Druart Signed-off-by: Nick Clemens (cherry picked from commit 59d436ee6023985a299f568fab9fd896492b207a) Signed-off-by: Martin Renvoize --- opac/errors/400.pl | 4 +--- opac/errors/401.pl | 4 +--- opac/errors/402.pl | 4 +--- opac/errors/403.pl | 4 +--- opac/errors/404.pl | 4 +--- opac/errors/500.pl | 4 +--- opac/opac-account-pay-paypal-return.pl | 3 +-- opac/opac-alert-subscribe.pl | 4 +--- opac/opac-authorities-home.pl | 3 +-- opac/opac-authoritiesdetail.pl | 3 +-- opac/opac-browser.pl | 3 +-- opac/opac-ics.pl | 3 +-- opac/opac-image.pl | 3 +-- opac/opac-imageviewer.pl | 3 +-- opac/opac-messaging.pl | 3 +-- opac/opac-modrequest-suspend.pl | 3 +-- opac/opac-modrequest.pl | 3 +-- opac/opac-mymessages.pl | 3 +-- opac/opac-overdrive-search.pl | 3 +-- opac/opac-passwd.pl | 3 +-- opac/opac-patron-image.pl | 3 +-- opac/opac-privacy.pl | 2 +- opac/opac-ratings-ajax.pl | 3 +-- opac/opac-ratings.pl | 3 +-- opac/opac-readingrecord.pl | 3 +-- opac/opac-renew.pl | 3 +-- opac/opac-sendshelf.pl | 3 +-- opac/opac-serial-issues.pl | 3 +-- opac/opac-showreviews.pl | 3 +-- opac/opac-suggestions.pl | 4 ++-- opac/opac-tags_subject.pl | 3 +-- opac/opac-topissues.pl | 3 +-- opac/opac-user.pl | 3 +-- opac/sco/help.pl | 3 +-- opac/sco/printslip.pl | 3 +-- opac/sco/sco-patron-image.pl | 3 +-- opac/svc/overdrive_proxy | 3 +-- opac/svc/suggestion | 3 +-- opac/unapi | 3 +-- 39 files changed, 40 insertions(+), 84 deletions(-) diff --git a/opac/errors/400.pl b/opac/errors/400.pl index d2009c5b08..4ed8cc410f 100755 --- a/opac/errors/400.pl +++ b/opac/errors/400.pl @@ -16,9 +16,7 @@ # along with Koha; if not, see . -use strict; -use warnings; - +use Modern::Perl; use CGI qw ( -utf8 ); use C4::Auth; use C4::Output; diff --git a/opac/errors/401.pl b/opac/errors/401.pl index 2c1d60e06e..59e373f0cf 100755 --- a/opac/errors/401.pl +++ b/opac/errors/401.pl @@ -16,9 +16,7 @@ # along with Koha; if not, see . -use strict; -use warnings; - +use Modern::Perl; use CGI qw ( -utf8 ); use C4::Auth; use C4::Output; diff --git a/opac/errors/402.pl b/opac/errors/402.pl index 492495ea40..80256e790d 100755 --- a/opac/errors/402.pl +++ b/opac/errors/402.pl @@ -16,9 +16,7 @@ # along with Koha; if not, see . -use strict; -use warnings; - +use Modern::Perl; use CGI qw ( -utf8 ); use C4::Auth; use C4::Output; diff --git a/opac/errors/403.pl b/opac/errors/403.pl index 8e502bbd33..3ea0306d99 100755 --- a/opac/errors/403.pl +++ b/opac/errors/403.pl @@ -16,9 +16,7 @@ # along with Koha; if not, see . -use strict; -use warnings; - +use Modern::Perl; use CGI qw ( -utf8 ); use C4::Auth; use C4::Output; diff --git a/opac/errors/404.pl b/opac/errors/404.pl index 3a4e0443a5..5d2149507c 100755 --- a/opac/errors/404.pl +++ b/opac/errors/404.pl @@ -16,9 +16,7 @@ # along with Koha; if not, see . -use strict; -use warnings; - +use Modern::Perl; use CGI qw ( -utf8 ); use C4::Auth; use C4::Output; diff --git a/opac/errors/500.pl b/opac/errors/500.pl index 50fa33e1da..f129a32cdb 100755 --- a/opac/errors/500.pl +++ b/opac/errors/500.pl @@ -16,9 +16,7 @@ # along with Koha; if not, see . -use strict; -use warnings; - +use Modern::Perl; use CGI qw ( -utf8 ); use C4::Auth; use C4::Output; diff --git a/opac/opac-account-pay-paypal-return.pl b/opac/opac-account-pay-paypal-return.pl index 64292d480d..76f6d21810 100755 --- a/opac/opac-account-pay-paypal-return.pl +++ b/opac/opac-account-pay-paypal-return.pl @@ -17,8 +17,7 @@ # with Koha; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -use strict; -use warnings; +use Modern::Perl; use utf8; use CGI; diff --git a/opac/opac-alert-subscribe.pl b/opac/opac-alert-subscribe.pl index e8809e4f03..63de7d34d9 100755 --- a/opac/opac-alert-subscribe.pl +++ b/opac/opac-alert-subscribe.pl @@ -18,9 +18,7 @@ # along with Koha; if not, see . -use strict; -use warnings; - +use Modern::Perl; use CGI qw ( -utf8 ); use C4::Auth; use C4::Output; diff --git a/opac/opac-authorities-home.pl b/opac/opac-authorities-home.pl index 4dcb33c2e7..3ea2719412 100755 --- a/opac/opac-authorities-home.pl +++ b/opac/opac-authorities-home.pl @@ -18,8 +18,7 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; use CGI qw ( -utf8 ); use URI::Escape; diff --git a/opac/opac-authoritiesdetail.pl b/opac/opac-authoritiesdetail.pl index 438ef809ea..0f389a010e 100755 --- a/opac/opac-authoritiesdetail.pl +++ b/opac/opac-authoritiesdetail.pl @@ -36,8 +36,7 @@ parameters tables. =cut -use strict; -use warnings; +use Modern::Perl; use C4::AuthoritiesMarc; use C4::Auth; diff --git a/opac/opac-browser.pl b/opac/opac-browser.pl index b2e8a60dc8..519472f940 100755 --- a/opac/opac-browser.pl +++ b/opac/opac-browser.pl @@ -24,8 +24,7 @@ TODO :: Description here =cut -use strict; -use warnings; +use Modern::Perl; use C4::Auth; use C4::Context; diff --git a/opac/opac-ics.pl b/opac/opac-ics.pl index 1fbf351ea8..4069ce78ca 100755 --- a/opac/opac-ics.pl +++ b/opac/opac-ics.pl @@ -19,8 +19,7 @@ # This script builds an ICalendar file (rfc 2445) for use in programs such as Ical -use strict; -use warnings; +use Modern::Perl; use CGI qw ( -utf8 ); use Data::ICal; diff --git a/opac/opac-image.pl b/opac/opac-image.pl index 0318aa09f7..7a94e81d52 100755 --- a/opac/opac-image.pl +++ b/opac/opac-image.pl @@ -23,8 +23,7 @@ # # -use strict; -use warnings; +use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; diff --git a/opac/opac-imageviewer.pl b/opac/opac-imageviewer.pl index 8023d7deb5..09be474226 100755 --- a/opac/opac-imageviewer.pl +++ b/opac/opac-imageviewer.pl @@ -17,8 +17,7 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; use CGI qw ( -utf8 ); use C4::Auth; diff --git a/opac/opac-messaging.pl b/opac/opac-messaging.pl index 906d56fe4e..f7e1bdeda5 100755 --- a/opac/opac-messaging.pl +++ b/opac/opac-messaging.pl @@ -17,8 +17,7 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; use CGI qw ( -utf8 ); diff --git a/opac/opac-modrequest-suspend.pl b/opac/opac-modrequest-suspend.pl index 8058394b9a..debeb30f6d 100755 --- a/opac/opac-modrequest-suspend.pl +++ b/opac/opac-modrequest-suspend.pl @@ -15,8 +15,7 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; use CGI qw ( -utf8 ); use C4::Output; diff --git a/opac/opac-modrequest.pl b/opac/opac-modrequest.pl index 1c7a235706..e86cd43b34 100755 --- a/opac/opac-modrequest.pl +++ b/opac/opac-modrequest.pl @@ -22,8 +22,7 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; use CGI qw ( -utf8 ); use C4::Output; diff --git a/opac/opac-mymessages.pl b/opac/opac-mymessages.pl index fa28a697bc..31bbd0ccac 100755 --- a/opac/opac-mymessages.pl +++ b/opac/opac-mymessages.pl @@ -17,8 +17,7 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; use CGI qw ( -utf8 ); diff --git a/opac/opac-overdrive-search.pl b/opac/opac-overdrive-search.pl index 38d30b9dca..632d2c49ee 100755 --- a/opac/opac-overdrive-search.pl +++ b/opac/opac-overdrive-search.pl @@ -17,8 +17,7 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; use CGI qw ( -utf8 ); diff --git a/opac/opac-passwd.pl b/opac/opac-passwd.pl index b5ae895947..177dfb777d 100755 --- a/opac/opac-passwd.pl +++ b/opac/opac-passwd.pl @@ -18,8 +18,7 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; use CGI qw ( -utf8 ); diff --git a/opac/opac-patron-image.pl b/opac/opac-patron-image.pl index 328506dd82..6c24e48420 100755 --- a/opac/opac-patron-image.pl +++ b/opac/opac-patron-image.pl @@ -18,8 +18,7 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; use C4::Members; use CGI qw ( -utf8 ); use CGI::Cookie; # need to check cookies before having CGI parse the POST request diff --git a/opac/opac-privacy.pl b/opac/opac-privacy.pl index 8796a7a8dd..aa5598a40d 100755 --- a/opac/opac-privacy.pl +++ b/opac/opac-privacy.pl @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; +use Modern::Perl; use CGI qw ( -utf8 ); use C4::Auth; # checkauth, getborrowernumber. diff --git a/opac/opac-ratings-ajax.pl b/opac/opac-ratings-ajax.pl index 25675add0d..8620368b53 100755 --- a/opac/opac-ratings-ajax.pl +++ b/opac/opac-ratings-ajax.pl @@ -23,8 +23,7 @@ A script that takes an ajax json query, and then inserts or modifies a star-rati =cut -use strict; -use warnings; +use Modern::Perl; use CGI qw ( -utf8 ); use CGI::Cookie; # need to check cookies before having CGI parse the POST request diff --git a/opac/opac-ratings.pl b/opac/opac-ratings.pl index 1951a2daee..38c50d6fd1 100755 --- a/opac/opac-ratings.pl +++ b/opac/opac-ratings.pl @@ -25,8 +25,7 @@ note: there is currently no 'delete rating' functionality in this script =cut -use strict; -use warnings; +use Modern::Perl; use CGI qw ( -utf8 ); use C4::Auth; diff --git a/opac/opac-readingrecord.pl b/opac/opac-readingrecord.pl index 879a31ea61..49348adf45 100755 --- a/opac/opac-readingrecord.pl +++ b/opac/opac-readingrecord.pl @@ -16,8 +16,7 @@ # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; use CGI qw ( -utf8 ); diff --git a/opac/opac-renew.pl b/opac/opac-renew.pl index 676012ea6f..73606b0649 100755 --- a/opac/opac-renew.pl +++ b/opac/opac-renew.pl @@ -21,8 +21,7 @@ # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; use CGI qw ( -utf8 ); use C4::Circulation; diff --git a/opac/opac-sendshelf.pl b/opac/opac-sendshelf.pl index 3c19e61ebf..a3b6663cc2 100755 --- a/opac/opac-sendshelf.pl +++ b/opac/opac-sendshelf.pl @@ -17,8 +17,7 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; use CGI qw ( -utf8 ); use Encode qw( encode ); diff --git a/opac/opac-serial-issues.pl b/opac/opac-serial-issues.pl index 9fe6fc386a..b94935feee 100755 --- a/opac/opac-serial-issues.pl +++ b/opac/opac-serial-issues.pl @@ -18,8 +18,7 @@ # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; use CGI qw ( -utf8 ); use C4::Auth; diff --git a/opac/opac-showreviews.pl b/opac/opac-showreviews.pl index a711b7fa3a..fc6dc6cac1 100755 --- a/opac/opac-showreviews.pl +++ b/opac/opac-showreviews.pl @@ -18,8 +18,7 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; use CGI qw ( -utf8 ); use C4::Auth; diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl index 19493aae99..cf562fb97e 100755 --- a/opac/opac-suggestions.pl +++ b/opac/opac-suggestions.pl @@ -15,8 +15,8 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; + use CGI qw ( -utf8 ); use Encode qw( encode ); diff --git a/opac/opac-tags_subject.pl b/opac/opac-tags_subject.pl index e5e182b685..b083ef20d7 100755 --- a/opac/opac-tags_subject.pl +++ b/opac/opac-tags_subject.pl @@ -24,8 +24,7 @@ TODO :: Description here =cut -use strict; -use warnings; +use Modern::Perl; use C4::Auth; use C4::Context; diff --git a/opac/opac-topissues.pl b/opac/opac-topissues.pl index c3a7530df8..fbf0081a38 100755 --- a/opac/opac-topissues.pl +++ b/opac/opac-topissues.pl @@ -19,8 +19,7 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; use CGI qw ( -utf8 ); use C4::Auth; diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 4e54afcf5b..df604ca8d7 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -17,8 +17,7 @@ # along with Koha; if not, see . -use strict; -#use warnings; FIXME - Bug 2505 +use Modern::Perl; use CGI qw ( -utf8 ); diff --git a/opac/sco/help.pl b/opac/sco/help.pl index 2e6b58a1a9..30003e0feb 100755 --- a/opac/sco/help.pl +++ b/opac/sco/help.pl @@ -21,8 +21,7 @@ # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; use CGI qw ( -utf8 ); use C4::Auth qw(get_template_and_user); diff --git a/opac/sco/printslip.pl b/opac/sco/printslip.pl index e94077dc2a..cd31be94c1 100755 --- a/opac/sco/printslip.pl +++ b/opac/sco/printslip.pl @@ -26,8 +26,7 @@ It is called from sco-main.pl =cut -use strict; -use warnings; +use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; use C4::Auth qw/:DEFAULT get_session/; diff --git a/opac/sco/sco-patron-image.pl b/opac/sco/sco-patron-image.pl index 52d8e61316..a0ae29a70c 100755 --- a/opac/sco/sco-patron-image.pl +++ b/opac/sco/sco-patron-image.pl @@ -17,8 +17,7 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; use C4::Service; use C4::Members; use Koha::Patron::Images; diff --git a/opac/svc/overdrive_proxy b/opac/svc/overdrive_proxy index 052a7b9d2a..9751f6343e 100755 --- a/opac/svc/overdrive_proxy +++ b/opac/svc/overdrive_proxy @@ -32,8 +32,7 @@ JS side from having to deal with cross-origin/authentication issues. =cut -use strict; -use warnings; +use Modern::Perl; use CGI qw(-oldstyle_urls -utf8); use JSON; diff --git a/opac/svc/suggestion b/opac/svc/suggestion index 8ed08a2301..f4fb1d8722 100755 --- a/opac/svc/suggestion +++ b/opac/svc/suggestion @@ -51,8 +51,7 @@ Number of suggestions to display. Defaults to 4 in stub mode, 20 otherwise. =cut -use strict; -use warnings; +use Modern::Perl; use C4::Auth; use C4::Context; diff --git a/opac/unapi b/opac/unapi index 9202683083..fb5ce0fcbd 100755 --- a/opac/unapi +++ b/opac/unapi @@ -17,8 +17,7 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; =head1 NAME -- 2.39.5