View | Details | Raw Unified | Return to bug 26995
Collapse All | Expand All

(-)a/Koha/Patron.pm (-4 lines)
Lines 202-211 sub store { Link Here
202
            $self->surname( uc($self->surname) )
202
            $self->surname( uc($self->surname) )
203
                if C4::Context->preference("uppercasesurnames");
203
                if C4::Context->preference("uppercasesurnames");
204
204
205
            $self->relationship(undef) # We do not want to store an empty string in this field
206
              if defined $self->relationship
207
                     and $self->relationship eq "";
208
209
            unless ( $self->in_storage ) {    #AddMember
205
            unless ( $self->in_storage ) {    #AddMember
210
206
211
                # Generate a valid userid/login if needed
207
                # Generate a valid userid/login if needed
(-)a/about.pl (-4 lines)
Lines 491-498 $template->param( 'bad_yaml_prefs' => \@bad_yaml_prefs ) if @bad_yaml_prefs; Link Here
491
        SELECT COUNT(*)
491
        SELECT COUNT(*)
492
        FROM (
492
        FROM (
493
            SELECT relationship FROM borrower_relationships WHERE relationship='_bad_data'
493
            SELECT relationship FROM borrower_relationships WHERE relationship='_bad_data'
494
            UNION ALL
495
            SELECT relationship FROM borrowers WHERE relationship='_bad_data') a
496
    });
494
    });
497
495
498
    $bad_relationships_count = $bad_relationships_count->[0]->[0];
496
    $bad_relationships_count = $bad_relationships_count->[0]->[0];
Lines 501-508 $template->param( 'bad_yaml_prefs' => \@bad_yaml_prefs ) if @bad_yaml_prefs; Link Here
501
          SELECT DISTINCT(relationship)
499
          SELECT DISTINCT(relationship)
502
          FROM (
500
          FROM (
503
              SELECT relationship FROM borrower_relationships WHERE relationship IS NOT NULL
501
              SELECT relationship FROM borrower_relationships WHERE relationship IS NOT NULL
504
              UNION ALL
505
              SELECT relationship FROM borrowers WHERE relationship IS NOT NULL) a
506
    });
502
    });
507
503
508
    my %valid_relationships = map { $_ => 1 } split( /,|\|/, C4::Context->preference('borrowerRelationship') );
504
    my %valid_relationships = map { $_ => 1 } split( /,|\|/, C4::Context->preference('borrowerRelationship') );
(-)a/t/db_dependent/Koha/Patrons.t (-6 / +1 lines)
Lines 1661-1667 subtest 'Test Koha::Patrons::merge' => sub { Link Here
1661
};
1661
};
1662
1662
1663
subtest '->store' => sub {
1663
subtest '->store' => sub {
1664
    plan tests => 7;
1664
    plan tests => 6;
1665
    my $schema = Koha::Database->new->schema;
1665
    my $schema = Koha::Database->new->schema;
1666
    $schema->storage->txn_begin;
1666
    $schema->storage->txn_begin;
1667
1667
Lines 1700-1709 subtest '->store' => sub { Link Here
1700
    is( $patron_1->surname, $surname,
1700
    is( $patron_1->surname, $surname,
1701
        'Surname remains unchanged on store.');
1701
        'Surname remains unchanged on store.');
1702
1702
1703
    # Test relationship
1704
    $patron_1->relationship("")->store;
1705
    is( $patron_1->relationship, undef, );
1706
1707
    $schema->storage->dbh->{PrintError} = $print_error;
1703
    $schema->storage->dbh->{PrintError} = $print_error;
1708
    $schema->storage->txn_rollback;
1704
    $schema->storage->txn_rollback;
1709
1705
1710
- 

Return to bug 26995