5 description => "Move OpacMoreSearches to additional contents",
8 my ($dbh, $out) = @$args{qw(dbh out)};
9 # Get any existing value from the OpacMoreSearches system preference
10 my ( $opacmoresearches ) = $dbh->selectrow_array( q|
11 SELECT value FROM systempreferences WHERE variable='OpacMoreSearches';
13 if( $opacmoresearches ){
14 # Insert any values found from system preference into additional_contents
15 foreach my $lang ( 'default' ) {
16 $dbh->do( "INSERT INTO additional_contents ( category, code, location, branchcode, title, content, lang, published_on ) VALUES ('html_customizations', 'OpacMoreSearches', 'OpacMoreSearches', NULL, ?, ?, ?, CAST(NOW() AS date) )", undef, "OpacMoreSearches $lang", $opacmoresearches, $lang );
18 # Remove old system preference
19 $dbh->do("DELETE FROM systempreferences WHERE variable='OpacMoreSearches'");
20 say $out "Bug 24220 update done";