Bugzilla – Attachment 121814 Details for
Bug 28490
Cannot modify patrons in some categories (e.g. Child category)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28490: Revert "Bug 26995: Remove references to relationship column"
0004-Bug-28490-Revert-Bug-26995-Remove-references-to-rela.patch (text/plain), 5.80 KB, created by
Emmi Takkinen
on 2021-06-11 10:27:01 UTC
(
hide
)
Description:
Bug 28490: Revert "Bug 26995: Remove references to relationship column"
Filename:
MIME Type:
Creator:
Emmi Takkinen
Created:
2021-06-11 10:27:01 UTC
Size:
5.80 KB
patch
obsolete
>From 8f534c4db21d97f98be810f4e365020387d85aec Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= <joonas.kylmala@helsinki.fi> >Date: Wed, 2 Jun 2021 17:13:12 +0000 >Subject: [PATCH 4/8] Bug 28490: Revert "Bug 26995: Remove references to > relationship column" > >This reverts commit 1cc8a77c287666ed878ea58f17216793f52ce224. > >It was part of a patch set that removed actively used data and must be >therefore reverted. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> >Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >--- > 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, 16 insertions(+), 3 deletions(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index 19a9215c86..dc87674f4d 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -202,6 +202,10 @@ 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 de53ac02f5..32547afec1 100755 >--- a/about.pl >+++ b/about.pl >@@ -499,6 +499,8 @@ $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]; >@@ -507,6 +509,8 @@ $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 cd1cd9042b..a8d15914c1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/columns.def >+++ b/koha-tmpl/intranet-tmpl/prog/en/columns.def >@@ -6,6 +6,7 @@ > <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 0cf68acfb3..e9d71c0355 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 %] > <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 [% "borrower_relationships.relationship" | $HtmlTags tag="strong" %] column. 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 [% "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> > [% END %] > > [% IF wrong_relationships %] >@@ -273,7 +273,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 [% "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 [% "borrowers.relationship" | $HtmlTags tag="strong" %] and/or [% "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 b719aa41cc..120e981324 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 => 6; >+ plan tests => 7; > my $schema = Koha::Database->new->schema; > $schema->storage->txn_begin; > >@@ -1813,6 +1813,10 @@ 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.25.1 >
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 28490
:
121538
|
121545
|
121546
|
121547
|
121548
|
121549
|
121550
|
121551
|
121552
|
121595
|
121596
|
121597
|
121598
|
121599
|
121600
|
121601
|
121602
|
121655
|
121656
|
121661
|
121662
|
121663
|
121664
|
121665
|
121666
|
121667
|
121669
|
121811
|
121812
|
121813
|
121814
|
121815
|
121816
|
121817
|
121818
|
121823
|
121824
|
121825
|
121826
|
121827
|
121828
|
121829
|
121830
|
121915