Koha/authorities
Janusz Kaczmarek 8189cf1196 Bug 36799: Illegitimate modification of MARC authid field content (001)
It happens that librarians to save time open an authority editor by putting
in the URL, by hand, the authid prefixed, by mistake, with a blank (e.g.
.../authorities.pl?authid= 100 -- mind the space before 100).  In
such a case the editor opens with the right auth record (i.e. 100) but,
after saving the record, the content of the authid MARC field (001 for
a standard MARC 21 installation) results modified and contains
additional initial blanks.

Moreover, if the heading (1XX field) was modified in the authority record
during such an edit, the changes will not propagate to the linked
bibliographic records.  And won't in the future.

This is because in the authorities.pl script $authid is taken (and
continuously used) directly from CGI parameter, without any
validation and/or correction (line 540 in the current main branch).

Test plan:
==========
1. Open an auth record in the editor with an added space before
   authid value, e.g.:
   http://ktd:8081/cgi-bin/koha/authorities/detail.pl?authid= 100
   Modify the heading field -- in the ktd data set:
       150 Computerized typesetting
   Save the record.
2. a) Open the record for editing again--see the space added before
   the authid in field 001.  Close the editor (with Cancel).
   b) Try to go to the linked biblio records with Used in X records.
   Note no results, if using ES.
   c) Remove the space before authid (after an:) in the URL.
   Go to the linked biblio records.  See that the content of
   the field controlled by the modified auth record did not
   update.
3. Apply the patch; restart_all.
4. Repeat p. 1 and 2 with a different authid.  Everything should
   be OK now.

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>
(cherry picked from commit 4b66fbc4eb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 65e1816bba)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-05-30 19:18:03 +00:00
..
auth_finder.pl Bug 30554: Use XSLT (if enabled) in authority search cataloguing plugin 2024-05-28 15:59:22 +00:00
authorities-home.pl Bug 33406: (QA follow-up) Adjust tests and tidy 2023-09-17 22:49:50 -10:00
authorities.pl Bug 36799: Illegitimate modification of MARC authid field content (001) 2024-05-30 19:18:03 +00:00
blinddetail-biblio-search.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
detail-biblio-search.pl Bug 17600: Fix GetTagsLabels imports 2021-08-03 14:35:18 +02:00
detail.pl Bug 17600: Fix GetTagsLabels imports 2021-08-03 14:35:18 +02:00
export.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
merge.pl Bug 17600: Add missing imports in authorities/ 2021-08-03 14:55:26 +02:00
merge_ajax.pl Bug 28785: Adjust check_cookie_auth calls 2021-10-18 11:28:41 +02:00
ysearch.pl Bug 28785: Adjust check_cookie_auth calls 2021-10-18 11:28:41 +02:00