Bugzilla – Attachment 115538 Details for
Bug 26995
Drop column relationship from borrower tables
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26995: Remove references to relationship column
Bug-26995-Remove-references-to-relationship-column.patch (text/plain), 5.45 KB, created by
Kyle M Hall (khall)
on 2021-01-21 12:24:45 UTC
(
hide
)
Description:
Bug 26995: Remove references to relationship column
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2021-01-21 12:24:45 UTC
Size:
5.45 KB
patch
obsolete
>From 528e49df455b2742d239c076232f2c3641d8abe1 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 21 Jan 2021 06:59:00 -0500 >Subject: [PATCH] Bug 26995: Remove references to relationship column > >--- > 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 6ea9e5aae7..efad74cc17 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 50952166f0..a1f2ab58c8 100755 >--- a/about.pl >+++ b/about.pl >@@ -491,8 +491,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]; >@@ -501,8 +499,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 @@ > <field name="borrowers.initials">Initials</field> > <field name="borrowers.othernames">Other name</field> > <field name="borrowers.sex">Gender</field> >-<field name="borrowers.relationship">Relationship</field> > <field name="borrowers.streetnumber">Street number</field> > <field name="borrowers.streettype">Street type</field> > <field name="borrowers.address">Address</field> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >index 32a16a11f9..4b5dd760ba 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >@@ -246,7 +246,7 @@ > [% IF warnRelationships %] > <h2>Patron relationship problems</h2> > [% IF bad_relationships_count %] >- <p>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.</p> >+ <p>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.</p> > [% END %] > > [% IF wrong_relationships %] >@@ -256,7 +256,7 @@ > <li>[% rel.0 | html %]</li> > [% END %] > </ul> >- <p>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.</p> >+ <p>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.</p> > [% END %] > [% END %] > >diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t >index c2824082e7..adbd0611b7 100755 >--- a/t/db_dependent/Koha/Patrons.t >+++ b/t/db_dependent/Koha/Patrons.t >@@ -1661,7 +1661,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; > >@@ -1700,10 +1700,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.24.1 (Apple Git-126)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26995
:
115532
|
115533
|
115534
|
115537
|
115538
|
115539
|
120399
|
120400
|
120451
|
120452
|
120453
|
120744
|
120745
|
120746
|
120775
|
120793
|
120826