From 1cc8a77c287666ed878ea58f17216793f52ce224 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 21 Jan 2021 06:59:00 -0500 Subject: [PATCH] Bug 26995: Remove references to relationship column Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart Signed-off-by: Jonathan Druart --- Koha/Patron.pm | 4 ---- about.pl | 4 ---- koha-tmpl/intranet-tmpl/prog/en/columns.def | 1 - koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 4 ++-- t/db_dependent/Koha/Patrons.t | 6 +----- 5 files changed, 3 insertions(+), 16 deletions(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index dc87674f4d..19a9215c86 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -202,10 +202,6 @@ sub store { $self->surname( uc($self->surname) ) if C4::Context->preference("uppercasesurnames"); - $self->relationship(undef) # We do not want to store an empty string in this field - if defined $self->relationship - and $self->relationship eq ""; - unless ( $self->in_storage ) { #AddMember # Generate a valid userid/login if needed diff --git a/about.pl b/about.pl index 344790c4b8..992bc771f4 100755 --- a/about.pl +++ b/about.pl @@ -499,8 +499,6 @@ $template->param( 'bad_yaml_prefs' => \@bad_yaml_prefs ) if @bad_yaml_prefs; SELECT COUNT(*) FROM ( SELECT relationship FROM borrower_relationships WHERE relationship='_bad_data' - UNION ALL - SELECT relationship FROM borrowers WHERE relationship='_bad_data') a }); $bad_relationships_count = $bad_relationships_count->[0]->[0]; @@ -509,8 +507,6 @@ $template->param( 'bad_yaml_prefs' => \@bad_yaml_prefs ) if @bad_yaml_prefs; SELECT DISTINCT(relationship) FROM ( SELECT relationship FROM borrower_relationships WHERE relationship IS NOT NULL - UNION ALL - SELECT relationship FROM borrowers WHERE relationship IS NOT NULL) a }); my %valid_relationships = map { $_ => 1 } split( /,|\|/, C4::Context->preference('borrowerRelationship') ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/columns.def b/koha-tmpl/intranet-tmpl/prog/en/columns.def index a8d15914c1..cd1cd9042b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/columns.def +++ b/koha-tmpl/intranet-tmpl/prog/en/columns.def @@ -6,7 +6,6 @@ Initials Other name Gender -Relationship Street number Street type Address diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index 62ce7c1602..3f8bcebdd5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -263,7 +263,7 @@ [% IF warnRelationships %]

Patron relationship problems

[% IF bad_relationships_count %] -

Your database contained guarantee/guarantor pairs with no defined relationship. They have been set the value '_bad_data' in the [% "borrowers.relationship" | $HtmlTags tag="strong" %] and/or [% "borrower_relationships.relationship" | $HtmlTags tag="strong" %] columns. Fix them manually by recreating those relationships, or have your system's administrator correct the values.

+

Your database contained guarantee/guarantor pairs with no defined relationship. They have been set the value '_bad_data' in the [% "borrower_relationships.relationship" | $HtmlTags tag="strong" %] column. Fix them manually by recreating those relationships, or have your system's administrator correct the values.

[% END %] [% IF wrong_relationships %] @@ -273,7 +273,7 @@
  • [% rel.0 | html %]
  • [% END %] -

    If the relationship is one you want, please add it to the 'borrowerRelationship' system preference, otherwise have your system's administrator correct the values in [% "borrowers.relationship" | $HtmlTags tag="strong" %] and/or [% "borrower_relationships.relationship" | $HtmlTags tag="strong" %] in the database.

    +

    If the relationship is one you want, please add it to the 'borrowerRelationship' system preference, otherwise have your system's administrator correct the values in [% "borrower_relationships.relationship" | $HtmlTags tag="strong" %] in the database.

    [% END %] [% END %] diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t index 120e981324..b719aa41cc 100755 --- a/t/db_dependent/Koha/Patrons.t +++ b/t/db_dependent/Koha/Patrons.t @@ -1774,7 +1774,7 @@ subtest 'Test Koha::Patrons::merge' => sub { }; subtest '->store' => sub { - plan tests => 7; + plan tests => 6; my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; @@ -1813,10 +1813,6 @@ subtest '->store' => sub { is( $patron_1->surname, $surname, 'Surname remains unchanged on store.'); - # Test relationship - $patron_1->relationship("")->store; - is( $patron_1->relationship, undef, ); - $schema->storage->dbh->{PrintError} = $print_error; $schema->storage->txn_rollback; -- 2.39.5