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

(-)a/installer/data/mysql/atomicupdate/bug_28633.pl (-5 / +4 lines)
Lines 15-21 return { Link Here
15
                AFTER firstname
15
                AFTER firstname
16
            }
16
            }
17
            );
17
            );
18
            say $out "Added preferred name column to borrowers table";
18
            say $out "Added column 'borrowers.preferred_name'";
19
        }
19
        }
20
        if ( !column_exists( 'deletedborrowers', 'preferred_name' ) ) {
20
        if ( !column_exists( 'deletedborrowers', 'preferred_name' ) ) {
21
            $dbh->do(
21
            $dbh->do(
Lines 26-32 return { Link Here
26
                AFTER firstname
26
                AFTER firstname
27
            }
27
            }
28
            );
28
            );
29
            say $out "Added preferred name column to deletedborrowers table";
29
            say $out "Added column 'deletedborrowers.preferred_name'";
30
        }
30
        }
31
        if ( !column_exists( 'borrower_modifications', 'preferred_name' ) ) {
31
        if ( !column_exists( 'borrower_modifications', 'preferred_name' ) ) {
32
            $dbh->do(
32
            $dbh->do(
Lines 37-50 return { Link Here
37
                AFTER firstname
37
                AFTER firstname
38
            }
38
            }
39
            );
39
            );
40
            say $out "Added preferred name column to borrower_modifications table";
40
            say $out "Added column 'borrower_modifications.preferred_name'";
41
        }
41
        }
42
        my @default_patron_search_fields = split( '\|', C4::Context->preference('DefaultPatronSearchFields') );
42
        my @default_patron_search_fields = split( '\|', C4::Context->preference('DefaultPatronSearchFields') );
43
        unless ( grep /preferred_name/, @default_patron_search_fields ) {
43
        unless ( grep /preferred_name/, @default_patron_search_fields ) {
44
            if ( grep /firstname/, @default_patron_search_fields ) {
44
            if ( grep /firstname/, @default_patron_search_fields ) {
45
                push @default_patron_search_fields, 'preferred_name';
45
                push @default_patron_search_fields, 'preferred_name';
46
                C4::Context->set_preference( 'DefaultPatronSearchFields', join( '|', @default_patron_search_fields ) );
46
                C4::Context->set_preference( 'DefaultPatronSearchFields', join( '|', @default_patron_search_fields ) );
47
                say $out "Added preferred name to DefaultPatronSearchFields";
47
                say $out "Added 'preferred_name' to DefaultPatronSearchFields";
48
            } else {
48
            } else {
49
                say $out "Please add 'preferred_name' to DefaultPatronSearchFields if you want it searched by default";
49
                say $out "Please add 'preferred_name' to DefaultPatronSearchFields if you want it searched by default";
50
            }
50
            }
51
- 

Return to bug 28633