Bug 28166 - Optionally add MARC fields to authority search
Summary: Optionally add MARC fields to authority search
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: MARC Authority data support (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Mark Hofstetter
QA Contact: Marcel de Rooy
URL:
Keywords:
: 19844 (view as bug list)
Depends on: 12747
Blocks:
  Show dependency treegraph
 
Reported: 2021-04-18 20:24 UTC by Mark Hofstetter
Modified: 2024-01-09 15:30 UTC (History)
9 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact: Rasa Satinskiene
Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/809
Text to go in the release notes:
With the new system preference `AdditionalFieldsInZ3950ResultAuthSearch` it is now possible to display additional information from the MARC record in the authority Z39.50/SRU search result lists.
Version(s) released in:
23.11.00


Attachments
patches Breeding.pm, cataloguing.pref, z3950_auth_search.tt (4.38 KB, patch)
2021-04-23 20:24 UTC, Mark Hofstetter
Details | Diff | Splinter Review
Bug 28166: optionally add marc fields to authority search (14.60 KB, patch)
2021-04-25 09:29 UTC, Mark Hofstetter
Details | Diff | Splinter Review
Bug 28166: optionally add marc fields to authority search (11.49 KB, patch)
2021-04-25 15:48 UTC, Mark Hofstetter
Details | Diff | Splinter Review
Bug 28166: Optionally add MARC fields to authority search (8.42 KB, patch)
2023-03-27 10:29 UTC, Mark Hofstetter
Details | Diff | Splinter Review
Bug 28166: Optionally add MARC fields to authority search (8.49 KB, patch)
2023-03-27 12:02 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 28166: Optionally add MARC fields to authority search (8.54 KB, patch)
2023-03-27 14:04 UTC, PTFS Europe Sandboxes
Details | Diff | Splinter Review
Bug 28166: Optionally add MARC fields to authority search (2.34 KB, patch)
2023-05-03 14:23 UTC, Mark Hofstetter
Details | Diff | Splinter Review
Bug 28166: Optionally add MARC fields to authority search (8.54 KB, patch)
2023-05-03 14:57 UTC, Mark Hofstetter
Details | Diff | Splinter Review
removed comments and _add_rowdata (1.68 KB, patch)
2023-05-03 14:57 UTC, Mark Hofstetter
Details | Diff | Splinter Review
Bug 28166: Removed comments and _add_rowdata (1.64 KB, patch)
2023-05-03 15:07 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 28166: (follow-up) Restore custom fields for biblios (1.23 KB, patch)
2023-05-03 15:25 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28166: Optionally add MARC fields to authority search (8.43 KB, patch)
2023-07-14 07:17 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 28166: Optionally add MARC fields to authority search (8.42 KB, patch)
2023-09-25 13:52 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28166: (QA follow-up) Fix and tidy tests and code (5.33 KB, patch)
2023-09-25 13:52 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28166: Optionally add MARC fields to authority search (8.50 KB, patch)
2023-10-04 14:53 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 28166: (QA follow-up) Fix and tidy tests and code (5.40 KB, patch)
2023-10-04 14:53 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 28166: Optionally add MARC fields to authority search (8.57 KB, patch)
2023-10-23 12:53 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28166: (QA follow-up) Fix and tidy tests and code (5.40 KB, patch)
2023-10-23 12:53 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hofstetter 2021-04-18 20:24:48 UTC
create feature + configuration similar to "AdditionalFieldsInZ3950ResultSearch" for Authorities 
"AdditionalFieldsInZ3950AuthResultSearch" 

as far as I see 

sub _add_custom_field_rowdata 

from package C4::Breeding;

could be reused if the the code is reflowed a little bit
Comment 1 Mark Hofstetter 2021-04-23 20:24:15 UTC
Created attachment 120139 [details] [review]
patches Breeding.pm,  cataloguing.pref, z3950_auth_search.tt

adds new syspref "AdditionalFieldsInZ3950ResultAuthSearch" for authorities analogous to AdditionalFieldsInZ3950ResultSearch
Comment 2 Katrin Fischer 2021-04-24 10:49:32 UTC
Hi Mark,

some hopefully helpful comments :)

Please take a look at the coding guidelines. We only capitalize the first word, so it would be "Additional fields" etc. Easy to fix, just something to keep in mind.

Is this meant to be ready for testing? Then don't forget to switch to "Needs signoff" as this will alert the testers and get it in the right queue.

But in order for them to be able to test with our tools, we'd need a patch file. Using git bz is really helpful here: https://wiki.koha-community.org/wiki/Git_bz_configuration
Comment 3 Mark Hofstetter 2021-04-25 09:29:10 UTC
Created attachment 120154 [details] [review]
Bug 28166: optionally add marc fields to authority search

this patch creates a new syspref: AdditionalFieldsInZ3950AuthResultSearch, analogous to AdditionalFieldsInZ3950ResultSearch

if this syspref is populated with with comma separated marc fields (eg '100, 400') those fields are displayed in in the z3950_auth_search

C4/Breeding.pm was slightly modified to be able to use "_add_custom_field_rowdata" to add the additonal fields

koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt was modified to display the "Addtional fields" conditionally

testing:
- add set values to AdditionalFieldsInZ3950AuthResultSearch the should show up in the auth_search
- AdditionalFieldsInZ3950ResultSearch should also be tested as it is also concerned
Comment 4 Katrin Fischer 2021-04-25 10:46:37 UTC
Looking much better, thx! 

But there are lots of unrelated and breaking changes in this patch I am afraid. :( The 0/1 for prefs is correct in master and should not be changed (see bug 22824).
Comment 5 Mark Hofstetter 2021-04-25 15:48:28 UTC
Created attachment 120155 [details] [review]
Bug 28166: optionally add marc fields to authority search

this patch creates a new syspref: AdditionalFieldsInZ3950AuthResultSearch, analogous to AdditionalFieldsInZ3950ResultSearch

if this syspref is populated with with comma separated marc fields (eg '100, 400') those fields are displayed in in the z3950_auth_search

C4/Breeding.pm was slightly modified to be able to use "_add_custom_field_rowdata" to add the additonal fields

koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt was modified to display the "Addtional fields" conditionally

testing:
- add set values to AdditionalFieldsInZ3950AuthResultSearch the should show up in the auth_search
- AdditionalFieldsInZ3950ResultSearch should also be tested as it is also concerned
Comment 6 Mark Hofstetter 2021-04-26 20:54:25 UTC
I've redone the patch, plz check again
Comment 7 Katrin Fischer 2021-06-04 09:26:54 UTC
Hi Mark, 

something is not quite right with the patch set. The first file is not a real patch file, the second only won't apply - I assume they are both needed from looking at the diffs, but as the first has the wrong format, this is not working.

Also, the second file contains a lot of unrelated changes in the yaml file. 
A change to the sysprefs.sql file is missing (https://wiki.koha-community.org/wiki/System_Preferences)

Can you provide one cleaned up patch file for master with all required changes?

--------------
Apply? [(y)es, (n)o, (i)nteractive] y
Traceback (most recent call last):
  File "/usr/local/bin/git-bz", line 2711, in <module>
    applied = do_apply(bug_ref)
  File "/usr/local/bin/git-bz", line 1820, in do_apply
    users = bug.server.get_xmlrpc_proxy().User.get({ 'names': [patch.attacher] })['users']
  File "/usr/lib/python2.7/xmlrpclib.py", line 1243, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1602, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1283, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1331, in single_request
    response.msg,
xmlrpclib.ProtocolError: <ProtocolError for bugs.koha-community.org/xmlrpc.cgi: 404 Not Found>
Comment 8 Mark Hofstetter 2023-03-27 10:29:07 UTC
Created attachment 148749 [details] [review]
Bug 28166: Optionally add MARC fields to authority search

adds the same feature to Authority Search as in the "normal" Z39.50 search, to display
arbitrary marc fields in the search results

1. apply patch
2. go to System preferences->Authorities preferences
3. the new option "AdditionalFieldsInZ3950ResultAuthSearch" shows up
4. enter the additional field numbers you want to see eg '001'
5. make an "Authority" search via Z39.50
6. the new new column "Additional fields" will display
7. sign off ;-)

Sponsored-by: Steiermärkische Landesbibliothek
Comment 9 ByWater Sandboxes 2023-03-27 12:02:29 UTC
Created attachment 148755 [details] [review]
Bug 28166: Optionally add MARC fields to authority search

adds the same feature to Authority Search as in the "normal" Z39.50 search, to display
arbitrary marc fields in the search results

1. apply patch
2. go to System preferences->Authorities preferences
3. the new option "AdditionalFieldsInZ3950ResultAuthSearch" shows up
4. enter the additional field numbers you want to see eg '001'
5. make an "Authority" search via Z39.50
6. the new new column "Additional fields" will display
7. sign off ;-)

Sponsored-by: Steiermärkische Landesbibliothek
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Comment 10 PTFS Europe Sandboxes 2023-03-27 14:04:26 UTC
Created attachment 148778 [details] [review]
Bug 28166: Optionally add MARC fields to authority search

adds the same feature to Authority Search as in the "normal" Z39.50 search, to display
arbitrary marc fields in the search results

1. apply patch
2. go to System preferences->Authorities preferences
3. the new option "AdditionalFieldsInZ3950ResultAuthSearch" shows up
4. enter the additional field numbers you want to see eg '001'
5. make an "Authority" search via Z39.50
6. the new new column "Additional fields" will display
7. sign off ;-)

Sponsored-by: Steiermärkische Landesbibliothek
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu>
Comment 11 Nick Clemens 2023-04-28 17:58:47 UTC
This looks neat, I like the feature, the patches need some cleanup

Must fix:
- the patch adds the function _add_rowdata, I think it's a rebase leftover?
- the call from _handle_one_result should be updated to pass the biblio related preference to the updated routine
- delete the commented lines from the code

Could fix:
- the routine should take a hashref, the more parameters we have, the nicer it i s to have them named
Comment 12 Mark Hofstetter 2023-05-03 14:22:49 UTC
Must fix:
- the patch adds the function _add_rowdata, I think it's a rebase leftover?

=> OK, done

- the call from _handle_one_result should be updated to pass the biblio related preference to the updated routine

=> I really don't understand this one, "_handle_one_result" is only used for bibs so nothing changes here

- delete the commented lines from the code
=> OK, done
Comment 13 Mark Hofstetter 2023-05-03 14:23:56 UTC
Created attachment 150590 [details] [review]
Bug 28166: Optionally add MARC fields to authority search

adds the same feature to Authority Search as in the "normal" Z39.50 search, to display
arbitrary marc fields in the search results

1. apply patch
2. go to System preferences->Authorities preferences
3. the new option "AdditionalFieldsInZ3950ResultAuthSearch" shows up
4. enter the additional field numbers you want to see eg '001'
5. make an "Authority" search via Z39.50
6. the new new column "Additional fields" will display
7. sign off ;-)

Sponsored-by: Steiermärkische Landesbibliothek
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu>
Comment 14 Mark Hofstetter 2023-05-03 14:57:22 UTC
Created attachment 150594 [details] [review]
Bug 28166: Optionally add MARC fields to authority search

adds the same feature to Authority Search as in the "normal" Z39.50 search, to display
arbitrary marc fields in the search results

1. apply patch
2. go to System preferences->Authorities preferences
3. the new option "AdditionalFieldsInZ3950ResultAuthSearch" shows up
4. enter the additional field numbers you want to see eg '001'
5. make an "Authority" search via Z39.50
6. the new new column "Additional fields" will display
7. sign off ;-)

Sponsored-by: Steiermärkische Landesbibliothek
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu>
Comment 15 Mark Hofstetter 2023-05-03 14:57:24 UTC
Created attachment 150595 [details] [review]
removed comments and _add_rowdata
Comment 16 Jonathan Druart 2023-05-03 15:07:22 UTC
Created attachment 150596 [details] [review]
Bug 28166: Removed comments and _add_rowdata
Comment 17 Jonathan Druart 2023-05-03 15:07:44 UTC
(Adjusted the commit title to make the QA script happy)
Comment 18 Nick Clemens 2023-05-03 15:21:19 UTC
(In reply to Mark Hofstetter from comment #12)
> Must fix:
> - the call from _handle_one_result should be updated to pass the biblio
> related preference to the updated routine
> 
> => I really don't understand this one, "_handle_one_result" is only used for
> bibs so nothing changes here


_handle_one_result calls _add_custom_field_rowdata

Previously _add_custom_field_rowdata fetched the system preference 'AdditionalFieldsInZ3950ResultSearch'

After these patches it expects to receive the additional fields in a parameter, we need to update the call


C4/Biblio.pm:
317         $row = _add_custom_field_rowdata($row, $marcrecord);
Comment 19 Nick Clemens 2023-05-03 15:25:54 UTC
Created attachment 150601 [details] [review]
Bug 28166: (follow-up) Restore custom fields for biblios

To test:
1 - Add "245$a" to AdditionalFieldsInZ3950ResultSearch preference
2 - Cataloging -> new from z3950
3 - Search and see results have 'additional fields' including the title
4 - Apply other patches
5 - Restart all
6 - Repeat Z39 Additional fields are now blank
7 - Apply thi patch, restart all
8 - Repeat Z39 search. Additional fields are restored
Comment 20 Marcel de Rooy 2023-07-14 07:17:28 UTC
Created attachment 153431 [details] [review]
Bug 28166: Optionally add MARC fields to authority search

adds the same feature to Authority Search as in the "normal" Z39.50 search, to display
arbitrary marc fields in the search results

1. apply patch
2. go to System preferences->Authorities preferences
3. the new option "AdditionalFieldsInZ3950ResultAuthSearch" shows up
4. enter the additional field numbers you want to see eg '001'
5. make an "Authority" search via Z39.50
6. the new new column "Additional fields" will display
7. sign off ;-)

Sponsored-by: Steiermärkische Landesbibliothek
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu>

Bug 28166: Removed comments and _add_rowdata

Bug 28166: (follow-up) Restore custom fields for biblios

To test:
1 - Add "245$a" to AdditionalFieldsInZ3950ResultSearch preference
2 - Cataloging -> new from z3950
3 - Search and see results have 'additional fields' including the title
4 - Apply other patches
5 - Restart all
6 - Repeat Z39 Additional fields are now blank
7 - Apply thi patch, restart all
8 - Repeat Z39 search. Additional fields are restored

Bug 28166: (QA follow-up) Fix rebase issue
Comment 21 Marcel de Rooy 2023-07-14 07:19:12 UTC
Had to rebase. Squashed it too to remove some developing cruft.
Comment 22 Marcel de Rooy 2023-07-14 07:19:47 UTC
We need some tests still. Breeding.t now fails.
Comment 23 Marcel de Rooy 2023-07-14 07:21:43 UTC
 WARN   C4/Breeding.pm
   WARN   tidiness
                The file is less tidy than before (bad/messy lines before: 217, now: 218)

 WARN   installer/data/mysql/atomicupdate/bug_28166.pl
   WARN   tidiness
                The file is less tidy than before (bad/messy lines before: 0, now: 5)

Since this was written before cutoff date, I wouldnt care too much.
Comment 24 Nick Clemens 2023-09-25 13:52:53 UTC
Created attachment 156166 [details] [review]
Bug 28166: Optionally add MARC fields to authority search

adds the same feature to Authority Search as in the "normal" Z39.50 search, to display
arbitrary marc fields in the search results

1. apply patch
2. go to System preferences->Authorities preferences
3. the new option "AdditionalFieldsInZ3950ResultAuthSearch" shows up
4. enter the additional field numbers you want to see eg '001'
5. make an "Authority" search via Z39.50
6. the new new column "Additional fields" will display
7. sign off ;-)

Sponsored-by: Steiermärkische Landesbibliothek
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu>

Bug 28166: Removed comments and _add_rowdata

Bug 28166: (follow-up) Restore custom fields for biblios

To test:
1 - Add "245$a" to AdditionalFieldsInZ3950ResultSearch preference
2 - Cataloging -> new from z3950
3 - Search and see results have 'additional fields' including the title
4 - Apply other patches
5 - Restart all
6 - Repeat Z39 Additional fields are now blank
7 - Apply thi patch, restart all
8 - Repeat Z39 search. Additional fields are restored

Bug 28166: (QA follow-up) Fix rebase issue
Comment 25 Nick Clemens 2023-09-25 13:52:55 UTC
Created attachment 156167 [details] [review]
Bug 28166: (QA follow-up) Fix and tidy tests and code
Comment 26 Katrin Fischer 2023-10-01 15:21:41 UTC
*** Bug 19844 has been marked as a duplicate of this bug. ***
Comment 27 Jonathan Druart 2023-10-04 14:53:20 UTC
Created attachment 156550 [details] [review]
Bug 28166: Optionally add MARC fields to authority search

adds the same feature to Authority Search as in the "normal" Z39.50 search, to display
arbitrary marc fields in the search results

1. apply patch
2. go to System preferences->Authorities preferences
3. the new option "AdditionalFieldsInZ3950ResultAuthSearch" shows up
4. enter the additional field numbers you want to see eg '001'
5. make an "Authority" search via Z39.50
6. the new new column "Additional fields" will display
7. sign off ;-)

Sponsored-by: Steiermärkische Landesbibliothek
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu>

Bug 28166: Removed comments and _add_rowdata

Bug 28166: (follow-up) Restore custom fields for biblios

To test:
1 - Add "245$a" to AdditionalFieldsInZ3950ResultSearch preference
2 - Cataloging -> new from z3950
3 - Search and see results have 'additional fields' including the title
4 - Apply other patches
5 - Restart all
6 - Repeat Z39 Additional fields are now blank
7 - Apply thi patch, restart all
8 - Repeat Z39 search. Additional fields are restored

Bug 28166: (QA follow-up) Fix rebase issue

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 28 Jonathan Druart 2023-10-04 14:53:23 UTC
Created attachment 156551 [details] [review]
Bug 28166: (QA follow-up) Fix and tidy tests and code

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 29 Tomás Cohen Arazi 2023-10-20 15:07:19 UTC
Please rebase ASAP. Thanks!
Comment 30 Nick Clemens 2023-10-23 12:53:15 UTC
Created attachment 157646 [details] [review]
Bug 28166: Optionally add MARC fields to authority search

adds the same feature to Authority Search as in the "normal" Z39.50 search, to display
arbitrary marc fields in the search results

1. apply patch
2. go to System preferences->Authorities preferences
3. the new option "AdditionalFieldsInZ3950ResultAuthSearch" shows up
4. enter the additional field numbers you want to see eg '001'
5. make an "Authority" search via Z39.50
6. the new new column "Additional fields" will display
7. sign off ;-)

Sponsored-by: Steiermärkische Landesbibliothek
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu>

Bug 28166: Removed comments and _add_rowdata

Bug 28166: (follow-up) Restore custom fields for biblios

To test:
1 - Add "245$a" to AdditionalFieldsInZ3950ResultSearch preference
2 - Cataloging -> new from z3950
3 - Search and see results have 'additional fields' including the title
4 - Apply other patches
5 - Restart all
6 - Repeat Z39 Additional fields are now blank
7 - Apply thi patch, restart all
8 - Repeat Z39 search. Additional fields are restored

Bug 28166: (QA follow-up) Fix rebase issue

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 31 Nick Clemens 2023-10-23 12:53:17 UTC
Created attachment 157647 [details] [review]
Bug 28166: (QA follow-up) Fix and tidy tests and code

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 32 Tomás Cohen Arazi 2023-10-23 14:37:37 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 33 Fridolin Somers 2023-10-26 06:46:06 UTC
Enhancement not pushed to 23.05.x
Comment 34 Rasa Satinskiene 2024-01-09 15:30:07 UTC
Manual updated.