[Koha-bugs] [Bug 32767] Optionally allow for trimming whitespace from patron attribute values

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Dec 15 13:46:23 CET 2023


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

PTFS Europe Sandboxes <sandboxes at ptfs-europe.com> changed:

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

--- Comment #14 from PTFS Europe Sandboxes <sandboxes at ptfs-europe.com> ---
Created attachment 159891
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=159891&action=edit
Bug 32767: New feature that trims attributes (if enabled) to avoid duplicates

Added a new "Trim identifier:" checkbox for attribute editor page, that if
enabled, will trim the value from any trailing whitespaces. The use case for
this feature is to avoid unintentionally creating duplicate attribute values
with trailing whitespaces around of it. If this checkbox is grayed for you,
that means that you have some values surrounded with whitespaces, and Koha
can't decide for you which you want to remove and when (because that as well
will lead to creating duplicated entries). So in order to use this feature you
first need to clean up your database from already existing values with trailing
whitespaces.

This SQL query might help you find all untrimmed attributes & borrowers:
```SELECT * FROM borrower_attributes WHERE code=%Attribute Name% AND attribute
REGEXP "^\\s+|\\s+$";```

Steps to reproduce:
1. Go to the attribute editor page. Check if the "Trim identifier:" checkbox is
not grayed. (if it is grayed, it means you have some values surrounded with
whitespaces, in that case you need to fix them manually)
2. Check the checkbox and save settings.
3. Add that attribute for a preferred patron, enter some value with a trailing
whitespaces around of it.
4. Check that the trailing whitespaces were trimmed correctly.

Signed-off-by: Sam Lau <samalau at gmail.com>
Signed-off-by: Anneli Österman <anneli.osterman at koha-suomi.fi>

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


More information about the Koha-bugs mailing list