diff --git a/installer/data/mysql/atomicupdate/bug_31274.pl b/installer/data/mysql/atomicupdate/bug_31274.pl new file mode 100755 index 0000000000..0f2865dc60 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_31274.pl @@ -0,0 +1,20 @@ +use Modern::Perl; + +return { + bug_number => "31274", + description => "OPACSuggestionAutoFill must be 1 or 0", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + + $dbh->do(q{ + UPDATE systempreferences + SET value = CASE + WHEN value='no' THEN 0 + WHEN value='yes' THEN 1 + ELSE value + END + WHERE variable='OPACSuggestionAutoFill'; + }); + }, +}; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index 555febc918..cd7e2836f0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -518,8 +518,8 @@ OPAC: - pref: OPACSuggestionAutoFill default: 0 choices: - yes: Enable - no: Disable + 1: Enable + 0: Disable - OPAC suggestions form automatically filling with data from Google Books API. - - "Use the following as the OPAC ISBD template:" diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt index 0a2a26460f..2b1f520b92 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt @@ -497,7 +497,7 @@ [% INCLUDE 'opac-bottom.inc' %] [% BLOCK jsinclude %] -[% IF ( Koha.Preference("OPACSuggestionAutoFill") != 'no' ) %] +[% IF Koha.Preference("OPACSuggestionAutoFill") %] [% Asset.js("js/autofill.js") | $raw %] [% END %] [% INCLUDE 'datatables.inc' %]