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

(-)a/installer/data/mysql/atomicupdate/bug_21978.pl (-3 / +9 lines)
Lines 33-43 return { Link Here
33
            });
33
            });
34
            say $out "Added middle name column to borrower_modifications table";
34
            say $out "Added middle name column to borrower_modifications table";
35
        }
35
        }
36
        my @default_patron_search_fields = split(',',C4::Context->preference('DefaultPatronSearchFields'));
36
37
        my ($default_patron_search_fields) = $dbh->selectrow_array( q{
38
            SELECT value FROM systempreferences WHERE variable='DefaultPatronSearchFields';
39
        });
40
        my @default_patron_search_fields = split(',',$default_patron_search_fields);
37
        unless( grep /middle_name/, @default_patron_search_fields ){
41
        unless( grep /middle_name/, @default_patron_search_fields ){
38
            if( grep /firstname/, @default_patron_search_fields ){
42
            if( grep /firstname/, @default_patron_search_fields ){
39
                push @default_patron_search_fields,'middle_name';
43
                push @default_patron_search_fields,'middle_name';
40
                C4::Context->set_preference('DefaultPatronSearchFields', join(',',@default_patron_search_fields) );
44
                my $new_patron_search_fields = join(',',@default_patron_search_fields);
45
                $dbh->do(q{
46
                    UPDATE systempreferences SET value=? WHERE variable='DefaultPatronSearchFields'
47
                }, undef, $new_patron_search_fields);
41
                say $out "Added middle name to DefaultPatronSearchFields";
48
                say $out "Added middle name to DefaultPatronSearchFields";
42
            } else {
49
            } else {
43
                say $out "Please add 'middlename' to DefaultPatronSearchFields if you want it searched by default";
50
                say $out "Please add 'middlename' to DefaultPatronSearchFields if you want it searched by default";
44
- 

Return to bug 21978