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

(-)a/installer/data/mysql/db_revs/231200036.pl (-3 / +19 lines)
Lines 30-35 return { Link Here
30
        }
30
        }
31
31
32
        $sth->execute( 'Collections', 'ccode', 'collection-code' );
32
        $sth->execute( 'Collections', 'ccode', 'collection-code' );
33
        $sth->execute( 'Holding libraries', 'holdingbranch', 'holdinglibrary' );
34
        $sth->execute( 'Home libraries',    'homebranch',    'homelibrary' );
33
35
34
        # Deal with DisplayLibraryFacets
36
        # Deal with DisplayLibraryFacets
35
        my ($DisplayLibraryFacets) = $dbh->selectrow_array(
37
        my ($DisplayLibraryFacets) = $dbh->selectrow_array(
Lines 45-53 return { Link Here
45
            $holdingbranch = 1;
47
            $holdingbranch = 1;
46
        } elsif ( $DisplayLibraryFacets eq 'home' ) {
48
        } elsif ( $DisplayLibraryFacets eq 'home' ) {
47
            $homebranch = 1;
49
            $homebranch = 1;
50
51
        }
52
        my $faceted_search_field = $dbh->selectall_arrayref(
53
            q{SELECT * FROM search_field WHERE facet_order IS NOT NULL ORDER BY facet_order},
54
            { Slice => {} }
55
        );
56
        my $facet_order = 1;
57
        $dbh->do(q{UPDATE search_field SET facet_order = NULL});
58
        for my $f (@$faceted_search_field) {
59
            next
60
                if $f->{name} eq 'homebranch' && !$homebranch;
61
            next
62
                if $f->{name} eq 'holdingbranch' && !$holdingbranch;
63
64
            $dbh->do( q{UPDATE search_field SET facet_order = ? WHERE name = ?}, undef, $facet_order, $f->{name} );
65
66
            $facet_order++;
48
        }
67
        }
49
        $sth->execute( 'Holding libraries', 'holdingbranch', 'holdinglibrary' ) if $holdingbranch;
50
        $sth->execute( 'Home libraries',    'homebranch',    'homelibrary' )    if $homebranch;
51
68
52
        say $out "Updated DisplayLibraryFacets and search field configuration";
69
        say $out "Updated DisplayLibraryFacets and search field configuration";
53
    },
70
    },
54
- 

Return to bug 37953