@@ -, +, @@ boolean everywhere - fix the template - fixes opac.pref for 0|1 - adds an atomicupdate that takes care of moving 'yes' and 'no' to their respective boolean values. $ koha-mysql kohadev > SELECT value FROM systempreferences WHERE variable='OPACSuggestionAutoFill'; $ updatedatabase --- .../data/mysql/atomicupdate/bug_31274.pl | 20 +++++++++++++++++++ .../en/modules/admin/preferences/opac.pref | 4 ++-- .../bootstrap/en/modules/opac-suggestions.tt | 2 +- 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug_31274.pl --- a/installer/data/mysql/atomicupdate/bug_31274.pl +++ a/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'; + }); + }, +}; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ a/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:" --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt +++ a/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' %] --