]> git.koha-community.org Git - koha.git/commit
Bug 31274: Make sure OPACSuggestionAutoFill is handled as a boolean everywhere
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 1 Aug 2022 14:38:01 +0000 (11:38 -0300)
committerLucas Gass <lucas@bywatersolutions.com>
Thu, 29 Sep 2022 16:03:53 +0000 (16:03 +0000)
commit44c7010fc1007f20b91e2f78a19705abae687cfb
tree4cad8d33b93fc87b56696656be565afe52deae53
parent558ee09dd5bb1dbffe5a70acfca5607c00f14cf8
Bug 31274: Make sure OPACSuggestionAutoFill is handled as a boolean everywhere

The YAML preference definition defines it as a string ('yes' or 'no' the
possible values). And the opac-suggestions.tt template has one occurence
of the variable being compared to a string.

This patch does:
- 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.

To test:
1. Change the syspref value to enable/disable
2. Check on the DB that the value is wrong:
   $ koha-mysql kohadev
   > SELECT value FROM systempreferences WHERE variable='OPACSuggestionAutoFill';
=> FAIL: It is either 'yes' or 'no' depending on what you choose.
3. Apply this patch
4. Run:
   $ updatedatabase
5. Repeat 2
=> SUCCESS: Values are now 0 or 1
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1c0b7bf01fabe7dfa558b29a7549c39a6f627c18)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
installer/data/mysql/atomicupdate/bug_31274.pl [new file with mode: 0755]
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt