Koha/Koha
Janusz Kaczmarek 35117c339e 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>
(cherry picked from commit c74169ba27)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 076b82d520)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-05-30 19:18:47 +00:00
..
Account Bug 32894: Remove wrong caching from Koha:: methods - simple 2023-07-12 07:50:40 +01:00
Acquisition Bug 33885: Make Koha::Acq::Order->creator return undef if no creator 2023-06-26 14:41:10 +02:00
App Bug 29498: Remove usage of deprecated Mojolicious::Routes::Route::detour 2022-01-18 21:15:04 -10:00
ArticleRequest
Auth Bug 30843: Add mfa_range configuration option for TOTP 2023-10-05 08:36:20 -10:00
Authority
BackgroundJob Bug 35979: (follow-up) Add check in ->enqueue 2024-05-28 20:23:43 +00:00
Biblio Bug 33270: (QA follow-up) Do not change param hashref 2023-07-19 09:27:44 +01:00
BiblioUtils Bug 29697: Use flag embed_items 2022-07-22 15:24:11 -03:00
Cache
Cash
Charges
Checkouts Bug 33362: Allow return claims to be resolved even if the issue has since been delete from the database 2023-05-24 11:21:31 -03:00
Club
CodeList/Unimarc
Config Bug 32478: Remove Koha::Config::SysPref->find since bypasses cache 2023-06-09 16:04:58 -03:00
Course Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Database Bug 32312: Add missing column descriptions to the statistics table 2023-11-07 22:13:04 -10:00
DateTime/Format Bug 36432: Remove circular dependency from Koha::Object 2024-05-28 16:36:58 +00:00
Edifact Bug 35173: Correctly concat error strings 2023-11-07 22:01:20 -10:00
ERM Bug 34789: Update usage throughout Koha modules and Vue components 2023-09-18 10:27:46 -10:00
Exceptions Bug 27249: Add missing POD for Koha::Exceptions::Calendar 2023-10-24 20:27:34 -10:00
Exporter Bug 25503: Make _get_biblio_for_export test pass 2023-05-10 15:26:19 -03:00
ExternalContent Bug 33697: Remove RecordedBooks (rbdigital) integration 2023-06-09 11:22:15 -03:00
Filter/MARC Bug 32464: Koha::Item->as_marc_field obsolete option mss 2023-06-09 12:04:54 -03:00
Hold
Illrequest Bug 21548: ILLLIBS patron category / partner_code seems extraneous 2023-03-31 12:14:51 +02:00
Import Bug 32437: (QA follow-up) Change to replace POD 2023-03-31 13:13:28 +02:00
Indexer
Item Bug 33739: Only trigger indexing on last item modification at ModItemTransfer 2023-05-16 11:26:06 +02:00
Library Bug 32894: Remove wrong caching from Koha:: methods - simple 2023-07-12 07:50:40 +01:00
List
MetadataRecord Bug 33205: (bug 28268 follow-up) Method call $row->authid inside quotes - produces meaningless warning 2024-05-28 19:29:09 +00:00
Middleware Bug 36149: (follow-up) POD and tidy 2024-05-01 15:35:19 +00:00
Misc
Notice Bug 30287: (follow-up) Add content wrap matching send time 2024-01-04 20:34:51 +00:00
Number Bug 26239: Do not format large negative numbers 2020-08-19 08:22:02 +02:00
OAI/Server Bug 34467: OAI GetRecord bad encoding for Unimarc 2023-10-09 20:39:15 -10:00
Object Bug 32894: Remove wrong caching from Koha:: methods - simple 2023-07-12 07:50:40 +01:00
Objects Bug 32735: (follow-up) Make Koha::Objects::Record::Collections->print_collection work with Authorities and Biblios 2023-05-05 12:13:50 -03:00
Old Bug 34609: Add biblio method to Old::Hold 2023-09-07 14:35:37 -10:00
Patron Bug 34731: (follow-up) Fix conditional variable declaration 2023-09-14 07:54:48 -10:00
Patrons Bug 34621: implement Patron import option to 'Renew existing patrons' 'from the current membership expiry date' 2024-05-28 19:21:41 +00:00
pdfformat Bug 33340: Correct formatting of English 1-page order PDF when it covers multiple pages 2023-05-16 15:17:28 -03:00
Plugins
RecordProcessor
REST Bug 36420: Allow Basic authentication using cardnumber 2024-05-28 19:33:20 +00:00
Result Bug 29746: (it-doesn't-hurt follow-up) More tests 2022-01-05 13:33:46 -10:00
Schema Bug 31297: DBIC 2024-01-12 20:38:37 +00:00
SearchEngine Bug 36678: Index fields with non-filing characters in both versions 2024-05-28 21:18:19 +00:00
Serial
Sitemapper
SMS
SMTP Bug 34622: Fix store default query 2023-09-20 20:06:10 -10:00
Subscription
SuggestionEngine
Tags
Template/Plugin Bug 35955: Cache CSRF token in template plugin 2024-03-19 21:23:36 +00:00
Ticket Bug 31028: Add catalog concern management page to staff 2023-03-06 11:23:17 -03:00
UI Bug 36794: Illegitimate modification of biblionumber subfield content (999 $c) 2024-05-30 19:18:47 +00:00
Util
XSLT Bug 12758: Add new module call in Koha::XSLT::Base 2022-11-09 09:52:25 -03:00
Z3950Responder Bug 24295: Remove GetTransfer from Z3950Responder 2022-08-26 15:42:07 -03:00
Account.pm Bug 34620: Do not throw expection if payment type is writeoff 2023-09-07 20:42:15 -10:00
ActionLog.pm
ActionLogs.pm
AdditionalContent.pm
AdditionalContents.pm Bug 29144: Add $contents->find_best_match, $library->opac_info 2022-09-16 09:55:19 -03:00
AdditionalField.pm Bug 11844: Fix QA issues (POD, TT filters, file exec flag) 2023-05-16 12:58:38 +02:00
AdditionalFields.pm
AdditionalFieldValue.pm
AdditionalFieldValues.pm
AdvancedEditorMacro.pm
AdvancedEditorMacros.pm
ApiKey.pm
ApiKeys.pm
ArticleRequest.pm Bug 32894: (QA follow-up) Fix typo 2023-07-12 07:50:40 +01:00
ArticleRequests.pm
AudioAlert.pm
AudioAlerts.pm
AuthorisedValue.pm Bug 30920: (follow-up) Flush on delete 2023-03-13 15:11:44 -03:00
AuthorisedValueCategories.pm
AuthorisedValueCategory.pm Bug 32997: Add REST API endpoint to list authorised values for multiple given categories 2023-03-02 12:00:15 -03:00
AuthorisedValues.pm Bug 35579: Cache authorised value lookup by MARC field 2024-01-12 22:02:27 +00:00
Authorities.pm Bug 33083: Add a generic class to handle methods for collections of records 2023-03-13 15:11:59 -03:00
Authority.pm Bug 33996: (QA follow-up) Fix mappings to match guidelines 2023-07-17 15:46:10 +01:00
AuthUtils.pm Bug 33341: Address some perlcritic errors in 5.36 2023-03-28 14:50:33 +02:00
BackgroundJob.pm Bug 35843: Correct invalid exception 2024-02-08 18:51:19 +00:00
BackgroundJobs.pm Bug 31969: Use filter_by_last_update 2022-11-25 09:40:09 -03:00
Biblio.pm Bug 33497: Add a filter relationship for branchtransfers 2023-07-17 16:41:30 +01:00
BiblioFramework.pm
BiblioFrameworks.pm
Biblioitem.pm
Biblioitems.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Biblios.pm Bug 33974: (follow-up) biblionumber column needs special handling 2023-07-17 16:26:38 +01:00
BiblioUtils.pm
Cache.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Caches.pm
Calendar.pm Bug 27249: Prevent infinite loop when searching for an open day 2023-10-24 20:27:34 -10:00
Checkout.pm Bug 30612: Rename other occurrences 2022-08-01 09:59:05 -03:00
Checkouts.pm
CirculationRule.pm Bug 32894: Remove wrong caching from Koha:: methods - simple 2023-07-12 07:50:40 +01:00
CirculationRules.pm Bug 32271: (QA follow-up) Correction to 'can_be_blank' logic 2023-08-07 20:05:46 -10:00
Cities.pm
City.pm
ClassSortRule.pm
ClassSortRules.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ClassSource.pm Bug 30920: (follow-up) Flush on delete 2023-03-13 15:11:44 -03:00
ClassSources.pm
ClassSplitRule.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ClassSplitRules.pm
Club.pm
Clubs.pm
Config.pm Bug 31393: Koha::Config: handle the special case for 'content' attribute 2023-11-07 22:14:09 -10:00
CookieManager.pm Bug 31250: (QA follow-up) The future will be easier 2022-09-12 15:34:11 -03:00
Course.pm
Courses.pm
CoverImage.pm
CoverImages.pm
CsvProfile.pm
CsvProfiles.pm
CurbsidePickup.pm
CurbsidePickupIssue.pm
CurbsidePickupIssues.pm
CurbsidePickupOpeningSlot.pm
CurbsidePickupOpeningSlots.pm
CurbsidePickupPolicies.pm
CurbsidePickupPolicy.pm Bug 32891: Fix slot selection in last hour 2023-02-21 10:22:28 -03:00
CurbsidePickups.pm
Database.pm
DateUtils.pm Bug 36432: Remove circular dependency from Koha::Object 2024-05-28 16:36:58 +00:00
Desk.pm
Desks.pm
EDI.pm Bug 35398: (QA follow-up) Tidy code 2024-03-19 15:21:43 +00:00
Edifact.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Email.pm
Encryption.pm Bug 33934: Add more detail to 'No encryption_key in koha-conf.xml' 2023-06-09 12:05:00 -03:00
Exception.pm
Exceptions.pm Bug 32334: Add general exception FileNotFound 2023-04-12 11:21:55 -03:00
ExternalContent.pm
FrameworkPlugin.pm Bug 35012: Apply change to all events 2023-11-14 09:03:53 -10:00
Hold.pm Bug 34333: Add Koha::Hold->cancellation_requested 2023-09-18 11:42:11 -10:00
Holds.pm Bug 32529: Add Koha::Holds->filter_by_found 2023-01-05 09:21:10 -03:00
I18N.pm Bug 35174: Do not explode if po dir does not exist 2023-11-22 09:33:46 +01:00
Illbackend.pm Bug 34223: (follow-up) Ensure consistent ordering of statuses 2023-09-14 08:23:44 -10:00
Illcomment.pm
Illcomments.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Illrequest.pm Bug 35105: Fix patron accessor in Illrequest.pm 2023-10-24 22:16:50 -10:00
Illrequestattribute.pm Bug 22440: Add standard accessors for later usage 2023-05-05 09:13:41 -03:00
Illrequestattributes.pm Bug 22440: New ILL requests table 2023-05-05 09:13:41 -03:00
Illrequests.pm Bug 22440: Add Koha::Illrequests->filter_by_visible 2023-05-05 09:13:40 -03:00
ImportBatch.pm
ImportBatches.pm
ImportBatchProfile.pm
ImportBatchProfiles.pm
Item.pm Bug 35167: Make 'effective_not_for_loan_status' fallback to 0 if itype has it undef 2023-11-02 10:31:49 -10:00
Items.pm Bug 34360: Get distinct biblionumber 2024-05-28 21:52:25 +00:00
ItemType.pm Bug 34008: Harmonize attribute names 2023-11-07 22:41:49 -10:00
ItemTypes.pm
KeyboardShortcut.pm
KeyboardShortcuts.pm
Libraries.pm
Library.pm Bug 30920: (follow-up) Flush on delete 2023-03-13 15:11:44 -03:00
Linktracker.pm
Localization.pm Bug 30920: (follow-up) Flush on delete 2023-03-13 15:11:44 -03:00
Localizations.pm
Logger.pm Bug 33020: (QA follow-up) POD and chmod 2023-02-27 11:33:50 -03:00
Manual.pm Bug 33790: Fix and add various links to the manual 2023-07-18 10:04:03 +01:00
MarcOverlayRule.pm
MarcOverlayRules.pm
MarcSubfieldStructure.pm
MarcSubfieldStructures.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
MessageAttribute.pm
MessageAttributes.pm
MetadataIterator.pm
MetadataRecord.pm Bug 30358: Strip leading/trailing whitespace characters from input fields when cataloguing 2023-05-16 15:17:26 -03:00
MetaSearcher.pm
MoreUtils.pm
OAuth.pm
OAuthAccessToken.pm
OAuthAccessTokens.pm
Object.pm Bug 36432: Remove circular dependency from Koha::Object 2024-05-28 16:36:58 +00:00
Objects.pm
Patron.pm Bug 19613: Use the 'note' profile 2024-05-01 15:33:51 +00:00
Patrons.pm Bug 36508: Refresh patron object when updating category 2024-05-23 14:08:27 +00:00
Plugins.pm Bug 35507: Add verbose parameters in Koha::Plugins 2024-02-14 16:29:01 +00:00
ProblemReport.pm Bug 4461: Update license statements 2020-04-06 11:18:39 +01:00
ProblemReports.pm
PseudonymizedTransaction.pm
PseudonymizedTransactions.pm
Quote.pm
Quotes.pm
Rating.pm
Ratings.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
RDF.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Recall.pm Bug 18398: Update C4::Message enqueue to use $patron->notice_email_address 2023-03-31 13:13:33 +02:00
Recalls.pm Bug 31147: Recalls should not adjust due time for related checkouts 2023-07-18 12:23:30 +01:00
RecordProcessor.pm
Report.pm Bug 27824: Trim column headers 2023-07-18 12:24:01 +01:00
Reports.pm
Review.pm
Reviews.pm
Schema.pm
Script.pm Bug 29857: Rename base class as Koha::Exception 2022-03-01 22:47:47 -10:00
SearchEngine.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
SearchField.pm
SearchFields.pm
SearchFilter.pm Bug 17170: (QA follow-up) Spec cleanup 2022-10-21 11:15:22 -03:00
SearchFilters.pm
SearchMarcMap.pm
SearchMarcMaps.pm
Serial.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Serials.pm
Session.pm Bug 36098: Default to 'file' if pref does not exist 2024-03-19 15:03:55 +00:00
SharedContent.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
SimpleMARC.pm Bug 24480: (follow-up) Shift new fields into array and add after all are copied 2023-11-09 15:58:08 -10:00
Sitemapper.pm
Statistic.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Statistics.pm
StockRotationItem.pm
StockRotationItems.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
StockRotationRota.pm
StockRotationRotas.pm
StockRotationStage.pm
StockRotationStages.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Subscription.pm
Subscriptions.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Suggestion.pm Bug 36122: NEW_SUGGESTION is sent for every modification to the suggestion 2024-05-28 21:24:09 +00:00
SuggestionEngine.pm
Suggestions.pm Bug 33238: Fix bad suggestions query (Bug 29886 follow-up) 2023-04-17 09:39:43 -03:00
Tag.pm
Tags.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Ticket.pm Bug 36612: (QA follow-up) Add 'source' to public_read_list 2024-05-23 14:23:41 +00:00
Tickets.pm Bug 31028: Add new Koha::Object(s) classes 2023-03-06 11:23:17 -03:00
Token.pm Bug 34755: Backport Koha::Token change from bug 34478 2024-03-19 21:26:05 +00:00
TrackedLink.pm
TrackedLinks.pm
UploadedFile.pm Bug 29156: File missing warning in Koha::UploadedFile for permanent files only 2022-01-21 21:34:51 -10:00
UploadedFiles.pm
Uploader.pm
Virtualshelf.pm Bug 32894: Remove wrong caching from Koha:: methods - simple 2023-07-12 07:50:40 +01:00
Virtualshelfcontent.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Virtualshelfcontents.pm
Virtualshelfshare.pm Bug 32894: Make ->sharee looks like others 2023-07-12 07:50:41 +01:00
Virtualshelfshares.pm
Virtualshelves.pm Bug 30418: Add ability for permitted staff to edit list contents 2023-05-15 18:23:57 -03:00
Z3950Responder.pm
Z3950Server.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Z3950Servers.pm