From b39b02c2f81a3c6be8b20c8dd55e5291a7fed1c5 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 31 Jan 2024 13:49:12 +0000 Subject: [PATCH] Bug 35959: Resolve Inconsistent hierarchy-warn from 4 modules Content-Type: text/plain; charset=utf-8 Inspired by https://www.perlmonks.org/?node_id=1151073 Clearing @ISA did not work, but pushing the relations seems to. Test plan: Run qa tools (to see results of perl -cw). (Ignore warning when processing files before patches.) Run some tests that use those modules. Touch a few pages referencing those modules. Signed-off-by: Marcel de Rooy Tested: prove t/db_dependent/AuthorisedValues.t t/db_dependent/Koha.t prove t/db_dependent/AuthorisedValues.t t/db_dependent/Koha.t t/db_dependent/Koha/Object.t prove t/db_dependent/Koha/Patron.t t/db_dependent/Koha/Patron/Attribute.t t/db_dependent/Koha/Patron/Attribute/Types.t prove t/db_dependent/Koha/Objects.t t/db_dependent/Koha/Patron/Categories.t admin/debit_types.pl admin/authorised_values.pl admin/patron-attr-types.pl admin/categories.pl --- Koha/Account/DebitType.pm | 5 ++++- Koha/AuthorisedValue.pm | 5 ++++- Koha/Patron/Attribute/Type.pm | 6 +++++- Koha/Patron/Category.pm | 7 ++++--- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Koha/Account/DebitType.pm b/Koha/Account/DebitType.pm index 1d5f7f1418..8cc2645566 100644 --- a/Koha/Account/DebitType.pm +++ b/Koha/Account/DebitType.pm @@ -19,10 +19,13 @@ package Koha::Account::DebitType; use Modern::Perl; +use Koha::Object; +use Koha::Object::Limit::Library; use Koha::Database; use Koha::Exceptions; -use base qw(Koha::Object Koha::Object::Limit::Library); +# Bug 35959 - Avoid Inconsistent hierarchy warn by replacing use base line +push @Koha::Account::DebitType::ISA, qw(Koha::Object Koha::Object::Limit::Library); =head1 NAME diff --git a/Koha/AuthorisedValue.pm b/Koha/AuthorisedValue.pm index da25d5e058..e756b1abc1 100644 --- a/Koha/AuthorisedValue.pm +++ b/Koha/AuthorisedValue.pm @@ -21,8 +21,11 @@ use Modern::Perl; use Koha::Caches; use Koha::Database; +use Koha::Object; +use Koha::Object::Limit::Library; -use base qw(Koha::Object Koha::Object::Limit::Library); +# Bug 35959 - Avoid Inconsistent hierarchy warn by replacing use base line +push @Koha::AuthorisedValue::ISA, qw(Koha::Object Koha::Object::Limit::Library); my $cache = Koha::Caches->get_instance(); diff --git a/Koha/Patron/Attribute/Type.pm b/Koha/Patron/Attribute/Type.pm index 772cad3c43..88166d927a 100644 --- a/Koha/Patron/Attribute/Type.pm +++ b/Koha/Patron/Attribute/Type.pm @@ -17,10 +17,14 @@ package Koha::Patron::Attribute::Type; use Modern::Perl; +use Koha::Object; +use Koha::Object::Limit::Library; + use Koha::Database; use Koha::Exceptions::Patron::Attribute::Type; -use base qw(Koha::Object Koha::Object::Limit::Library); +# Bug 35959 - Avoid Inconsistent hierarchy warn by replacing use base line +push @Koha::Patron::Attribute::Type::ISA, qw(Koha::Object Koha::Object::Limit::Library); =head1 NAME diff --git a/Koha/Patron/Category.pm b/Koha/Patron/Category.pm index e24c8d6e79..edc86d1881 100644 --- a/Koha/Patron/Category.pm +++ b/Koha/Patron/Category.pm @@ -16,15 +16,16 @@ package Koha::Patron::Category; # along with Koha; if not, see . use Modern::Perl; - use List::MoreUtils qw( any ); +use Koha::Object; +use Koha::Object::Limit::Library; use C4::Members::Messaging; - use Koha::Database; use Koha::DateUtils qw( dt_from_string ); -use base qw(Koha::Object Koha::Object::Limit::Library); +# Bug 35959 - Avoid Inconsistent hierarchy warn by replacing use base line +push @Koha::Patron::Category::ISA, qw(Koha::Object Koha::Object::Limit::Library); =head1 NAME -- 2.30.2