Koha/cataloguing
Janusz Kaczmarek c74169ba27
Bug 36794: Illegitimate modification of biblionumber subfield content (999 $c)
It happens that librarians, by mistake, open a biblio editor putting in the
URL, by hand, the biblionumber prefixed with a blank (e.g.
.../addbiblio.pl?biblionumber= 123 -- mind the space before 123).
In such a case the editor opens with the right biblio record (i.e. 123)
but, after saving the record, the content of the biblionumber MARC
field (999 $c for a standard MARC 21 installation) results modified and
contains additional initial blanks.

Moreover, while using ES and making a search for the record (with title,
author etc.) we get two records on the result list (instead of one).

This is because in the addbiblio.pl script $biblionumber is taken (and
continuously used) directly from CGI parameter, without any
validation and/or correction.

Test plan:
==========
0. Have a test installation with ES.
1. Open a biblio record in the editor with an added space before
   biblionumber value, e.g.:
   http://ktd:8081/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber= 123
   Save the record.
2. From the Normal view choose Save -> MARCXML.  Open the saved file in
   your favourite editor.  You should see, at the end, something like:
   <datafield tag="999" ind1=" " ind2=" ">
     <subfield code="c"> 123</subfield>
   (mind the space before 123).
   This is not right.
3. Make a search with the title or author's name from the record (e.g.
   Henning Mankell for the record 123 from the default ktd data set).
   You should get two records instead of one (while using ES).
4. Apply the patch, restart_all.  Repeat p. 1 and 2 with a different
   biblionumber.  Notice the unchanged (i.e. without spaces) value
   of 999 $c subfield in the exported record and only one record
   as a result of a search.

WNC amended patch - rebased, added conditional in case no bib, moved comments to their own lines

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-05-13 10:36:11 +02:00
..
value_builder Bug 33703: Add Maskito to dateaccessioned.pl 2024-04-26 17:06:10 +02:00
addbiblio.pl Bug 36794: Illegitimate modification of biblionumber subfield content (999 $c) 2024-05-13 10:36:11 +02:00
addbooks.pl Bug 29391: Improve output of reservoir search 2022-01-09 21:04:17 -10:00
additem.pl Bug 34478: Fix delallitems for additem 2024-03-01 11:00:19 +01:00
cataloging-home.pl Bug 34288: Allow access to the cataloguing module with tools permission 2023-07-18 12:46:53 -03:00
concerns.pl Bug 31028: (follow-up) Fix permissions names 2023-03-06 11:23:17 -03:00
editor.pl Bug 33375: Quote reserved keyword 'rank' in advanced editor 2023-04-14 11:35:26 -03:00
linkitem.pl Bug 34478: Add 'op' to catalogue/MARCdetail 2024-03-01 10:58:28 +01:00
merge.pl Bug 33036: REST API: Merge biblio records implements merging of records 2024-03-18 11:03:39 +01:00
merge_ajax.pl Bug 28785: Adjust check_cookie_auth calls 2021-10-18 11:28:41 +02:00
moveitem.pl Bug 34478: Add 'op' to cataloguing/moveitem 2024-03-01 10:58:29 +01:00
plugin_launcher.pl Bug 24879: Add check_cookie_auth when missing 2024-04-03 17:05:50 +02:00
ysearch.pl Bug 35835: Fix shebang in cataloguing/ysearch.pl 2024-01-26 15:14:03 +01:00
z3950_auth_search.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
z3950_search.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00