[Koha-bugs] [Bug 31274] OPACSuggestionAutoFill must be 1 or 0

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Aug 2 00:48:30 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31274

Aleisha Amohia <aleisha at catalyst.net.nz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #138476|0                           |1
        is obsolete|                            |

--- Comment #3 from Aleisha Amohia <aleisha at catalyst.net.nz> ---
Created attachment 138488
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=138488&action=edit
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 at theke.io>

Signed-off-by: Aleisha Amohia <aleishaamohia at hotmail.com>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list