Bug 20689 - Make it possible to add capital letter subfields to item search fields
Summary: Make it possible to add capital letter subfields to item search fields
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Katrin Fischer
QA Contact: Martin Renvoize
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-01 16:05 UTC by Patrick Robitaille
Modified: 2018-10-17 15:08 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 20689: Replace marc (sub)field pull downs with input fields on item search fields config (3.20 KB, patch)
2018-08-09 23:12 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 20689: Replace marc (sub)field pull downs with input fields on item search fields config (3.26 KB, patch)
2018-09-27 22:13 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 20689: Replace marc (sub)field pull downs with input fields on item search fields config (3.41 KB, patch)
2018-10-01 19:45 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 20689: (follow-up) Make it possible to add capital letter subfields to item search fields (4.10 KB, patch)
2018-10-12 16:31 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 20689: (follow-up) Make it possible to add capital letter subfields to item search fields (4.16 KB, patch)
2018-10-12 16:43 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 20689: Replace marc (sub)field pull downs with input fields on item search fields config (3.47 KB, patch)
2018-10-17 14:05 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 20689: (follow-up) Make it possible to add capital letter subfields to item search fields (4.22 KB, patch)
2018-10-17 14:05 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Robitaille 2018-05-01 16:05:13 UTC
Hi, 

when you add a new subfield in a marc bibliographic framework and that subfield is not in the marc format normally, you can not add it as a item search fields. It would be useful to be able to use these new subfields for item search for exemple.

Thanks, Patrick.
Comment 1 Katrin Fischer 2018-05-01 16:23:22 UTC
Do you mean capital letter subfields?
Comment 2 Patrick Robitaille 2018-05-07 12:21:05 UTC
Hi Katrin, 

It is exactly what I mean. 

Thanks, Patrick.
Comment 3 Katrin Fischer 2018-08-09 23:12:28 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2018-09-27 22:13:37 UTC
Created attachment 79554 [details] [review]
Bug 20689: Replace marc (sub)field pull downs with input fields on item search fields config

The pull down for marc subfields on the item search fields config page is
long and hard to use. It also doesn't include the commonly used
upper case letters for custom item subfields.

Also hard to use with its 999 entries is the marc field list. It doesn't
allow for tags like 01e, which exist in our MARC21 default framework.

To test:
- Go to Administration > Item search fields
- Add different mappings with and without subfields
- Verify the entered values are stored correctly
- Edit mappings
- Verify editing works and changes save correctly
Comment 5 Séverine Queune 2018-10-01 19:45:36 UTC
Created attachment 79779 [details] [review]
Bug 20689: Replace marc (sub)field pull downs with input fields on item search fields config

The pull down for marc subfields on the item search fields config page is
long and hard to use. It also doesn't include the commonly used
upper case letters for custom item subfields.

Also hard to use with its 999 entries is the marc field list. It doesn't
allow for tags like 01e, which exist in our MARC21 default framework.

To test:
- Go to Administration > Item search fields
- Add different mappings with and without subfields
- Verify the entered values are stored correctly
- Edit mappings
- Verify editing works and changes save correctly

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 6 Séverine Queune 2018-10-01 19:47:03 UTC
Great enhancement Katrin !
Thanks a lot !
Comment 7 Katrin Fischer 2018-10-01 20:48:44 UTC
(In reply to Séverine Queune from comment #6)
> Great enhancement Katrin !
> Thanks a lot !

Thx for testing!
Comment 8 Jonathan Druart 2018-10-02 12:02:05 UTC
I may be a bad person but, ofc, I tried to find a bug. So I filled field="~" and subfield="€"
The search did not like it :)

I think we should keep the list of field/subfield exhaustive, and maybe add select2 to these 2 selects? Or at least add validation code to catch possible problems.

Note: You will need the patch I have just submitted on bug 13618 comment 261 to test it correctly.
Comment 9 Katrin Fischer 2018-10-02 14:05:08 UTC
We don't do this in the MARC frameworks and I think some odd characters would be allowed in the standard... I've thought about it and tried to implement an HTML filter, but didn't succeed. But we are not that strict in other places and I think a list with 999+ elements is not the solution :) As I said, we even fields with letters in our database.
Comment 10 Jonathan Druart 2018-10-02 14:54:10 UTC
So maybe just a JS check for \d | \w ?
Comment 11 Martin Renvoize 2018-10-12 15:06:06 UTC
Checking for digits and word characters as per Jonathans suggestion sounds sane to me... is there really a case out there where a field may contain another character outside that range?
Comment 12 Owen Leonard 2018-10-12 16:31:41 UTC
Created attachment 80538 [details] [review]
Bug 20689: (follow-up) Make it possible to add capital letter subfields to item search fields

This patch adds some custom validation to the MARC tag and subfield
fields so that they are limited to alphanumeric characters.

To test, apply the patch and test the form by entering a variety of
different character combinations. The "MARC field" and "MARC subfield"
inputs should only accept alphanumeric entries.
Comment 13 Katrin Fischer 2018-10-12 16:43:20 UTC
Created attachment 80539 [details] [review]
Bug 20689: (follow-up) Make it possible to add capital letter subfields to item search fields

This patch adds some custom validation to the MARC tag and subfield
fields so that they are limited to alphanumeric characters.

To test, apply the patch and test the form by entering a variety of
different character combinations. The "MARC field" and "MARC subfield"
inputs should only accept alphanumeric entries.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 14 Marcel de Rooy 2018-10-12 16:59:43 UTC
Not sure if we should facilitate MARC deviation ?
Comment 15 Katrin Fischer 2018-10-12 17:02:51 UTC
We could also start supporting other ASCII characters like ;/% for subfield codes, that would give us more subfields for items to use - but it won't work right now and the upper case letter use is a reality not only for us but other libraries too (see Severine's comment).
Comment 16 Martin Renvoize 2018-10-17 14:05:13 UTC
Created attachment 80712 [details] [review]
Bug 20689: Replace marc (sub)field pull downs with input fields on item search fields config

The pull down for marc subfields on the item search fields config page is
long and hard to use. It also doesn't include the commonly used
upper case letters for custom item subfields.

Also hard to use with its 999 entries is the marc field list. It doesn't
allow for tags like 01e, which exist in our MARC21 default framework.

To test:
- Go to Administration > Item search fields
- Add different mappings with and without subfields
- Verify the entered values are stored correctly
- Edit mappings
- Verify editing works and changes save correctly

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 17 Martin Renvoize 2018-10-17 14:05:18 UTC
Created attachment 80713 [details] [review]
Bug 20689: (follow-up) Make it possible to add capital letter subfields to item search fields

This patch adds some custom validation to the MARC tag and subfield
fields so that they are limited to alphanumeric characters.

To test, apply the patch and test the form by entering a variety of
different character combinations. The "MARC field" and "MARC subfield"
inputs should only accept alphanumeric entries.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 18 Martin Renvoize 2018-10-17 14:06:24 UTC
(In reply to Marcel de Rooy from comment #14)
> Not sure if we should facilitate MARC deviation ?

I don't think this is too terrible a deviation, especially as it appears to already be widely in use.
Comment 19 Martin Renvoize 2018-10-17 14:06:53 UTC
It all works as expected for me and I can't find any regressions.

Passing QA
Comment 20 Jonathan Druart 2018-10-17 15:08:06 UTC
Sorry but... the validation does not work when a new field is added, only when it is edited.