Koha/Koha
Martin Renvoize bafd7cff70 Bug 29781: Enable capture groups in batch item modification
This patch adds support for regular expression capture groups in
MarcModificationTemplates.

We escape double quotes in the replacement string, then quote the whole
string before applying the `ee` modifier to the final regex
application.

See https://blog.james.rcpt.to/2010/10/25/perl-search-and-replace-using-variables/
for further details.

Test plan
1) Attempt to use capture groups in your regular expression based
   batch item modification and note it does not work.
2) Apply the patch and try again, this time the capture group
   should yield the expected results.
3) Run t/SimpleMARC.t and confirm the tests still pass.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Jo Hunter <jhunter@clicweb.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-02-16 11:51:11 -10:00
..
Account Bug 29844: Fix t/db_dependent/Koha/* 2022-02-09 15:36:23 -10:00
Acquisition Bug 29859: Use iterator instead of as_list 2022-02-09 15:36:23 -10:00
App Bug 29498: Remove usage of deprecated Mojolicious::Routes::Route::detour 2022-01-18 21:15:04 -10:00
ArticleRequest
Authority
BackgroundJob Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
Biblio
BiblioUtils
Cache
Cash
Charges
Checkouts Bug 29495: (follow-up) Use 'item' relationship 2022-01-17 14:55:55 -10:00
Club Bug 29562: Adjust CanItemBeReserved and checkHighHolds to take objects 2022-01-31 21:55:39 -10:00
Config
Course
Edifact Bug 29670: Fix EDI for AcqCreateItem = 'placing on order' 2022-01-18 21:15:04 -10:00
Exceptions Bug 14957: (QA follow-up) Rename 'merge' => 'overlay' 2021-10-26 16:46:02 +02:00
Exporter
ExternalContent Bug 29686: Adapt Koha to use new fulfillment API for OverDrive 2022-01-28 11:09:06 -10:00
Filter/MARC Bug 29764: Fix incorrect EmbedItems RecordProcessor filter POD 2022-01-19 12:13:49 -10:00
Illrequest
Import Bug 26326: (follow-up) Add ability to check for existence of any primary key 2021-11-03 15:40:52 +01:00
Indexer
Item
Library Bug 29859: Use iterator instead of as_list 2022-02-09 15:36:23 -10:00
List
MetadataRecord
Middleware
Misc
Notice
Number
OAI/Server Bug 29484: Make ListSets return noSetHierarchy when no sets defined 2021-12-10 21:14:59 -10:00
Object
Objects Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
Old Bug 29843: Add ->anonymize and ->filter_by_anonymizable to Koha::Old::Checkouts 2022-02-10 14:44:23 -10:00
Patron Bug 29847: Make Koha::Patron::HouseboundProfile->housebound_visits return a resultset 2022-02-09 15:36:23 -10:00
Patrons
pdfformat
Plugins
RecordProcessor
REST Bug 29570: Simplify for loop 2022-02-14 21:41:38 -10:00
Result Bug 29746: (it-doesn't-hurt follow-up) More tests 2022-01-05 13:33:46 -10:00
Schema Bug 29525: Add Koha::Old::Holds->filter_by_anonymizable 2022-02-10 14:44:22 -10:00
SearchEngine Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
Serial
Sitemapper
SMS
SMTP Bug 29427: Make SMTP transport set debug mode correctly 2021-11-08 12:16:31 +01:00
Subscription
SuggestionEngine
Tags
Template/Plugin Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
UI Bug 29788: Fix batch delete item 2022-01-11 12:38:35 -10:00
Util Bug 11175: (QA follow-up) Move get_component_part_query 2021-10-26 16:46:02 +02:00
XSLT
Z3950Responder
Account.pm Bug 29785: Rename Koha::Object->message with ->object_messages 2022-02-09 22:01:36 -10:00
ActionLog.pm
ActionLogs.pm
AdditionalContent.pm
AdditionalContents.pm Bug 29332: Set default library limits in search_for_display 2021-10-28 12:16:37 +02:00
AdditionalField.pm
AdditionalFields.pm
AdditionalFieldValue.pm
AdditionalFieldValues.pm
AdvancedEditorMacro.pm
AdvancedEditorMacros.pm
ApiKey.pm
ApiKeys.pm
ArticleRequest.pm Bug 29759: Make cancelling an AR refund 2022-01-31 21:55:39 -10:00
ArticleRequests.pm
AudioAlert.pm
AudioAlerts.pm Bug 29859: Use iterator instead of as_list 2022-02-09 15:36:23 -10:00
AuthorisedValue.pm
AuthorisedValueCategories.pm
AuthorisedValueCategory.pm
AuthorisedValues.pm Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
Authorities.pm
Authority.pm
AuthUtils.pm
BackgroundJob.pm Bug 28413: Reduce background job worker memory footprint 2021-11-05 12:17:08 +01:00
BackgroundJobs.pm
Biblio.pm Bug 27266: (follow-up) Using biblio frameworkcode to get rid of FIXME 2021-12-15 12:15:10 -10:00
BiblioFramework.pm
BiblioFrameworks.pm
Biblioitem.pm
Biblioitems.pm
Biblios.pm
BiblioUtils.pm
Cache.pm
Caches.pm
Calendar.pm
Checkout.pm Bug 29290: Rename relationships borrower => patron 2021-10-28 17:32:34 +02:00
Checkouts.pm
CirculationRule.pm
CirculationRules.pm Bug 27946: Add article request fee to circulation rules 2022-01-28 11:09:07 -10:00
Cities.pm
City.pm
ClassSortRule.pm
ClassSortRules.pm
ClassSource.pm
ClassSources.pm
ClassSplitRule.pm
ClassSplitRules.pm
Club.pm Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
Clubs.pm Bug 29844: Simplify Koha::Clubs->get_enrollable 2022-02-09 15:36:23 -10:00
Config.pm
Course.pm
Courses.pm
CoverImage.pm
CoverImages.pm
CsvProfile.pm
CsvProfiles.pm
Database.pm
DateUtils.pm Bug 29403: Match the whole string 2022-01-28 11:09:06 -10:00
Desk.pm
Desks.pm
EDI.pm
Edifact.pm
Email.pm Bug 29330: Add Koha::Email->new_from_string 2021-11-15 12:38:39 +01:00
Exceptions.pm
ExternalContent.pm
FrameworkPlugin.pm
Hold.pm Bug 29525: Make Koha::Hold->fill anonymize if required 2022-02-10 14:44:22 -10:00
Holds.pm Bug 29859: (QA follow-up) Minor typo correction 2022-02-09 15:36:24 -10:00
I18N.pm
Illcomment.pm
Illcomments.pm
Illrequest.pm Bug 28932: Fix duplicate next_action & prev_action 2022-01-17 14:55:56 -10:00
Illrequestattribute.pm
Illrequestattributes.pm
Illrequests.pm
ImportBatch.pm
ImportBatches.pm
ImportBatchProfile.pm
ImportBatchProfiles.pm
Item.pm Bug 26704: Update Koha::Item to use Koha::Object::Messages 2022-02-14 21:41:38 -10:00
Items.pm Bug 29781: Enable capture groups in batch item modification 2022-02-16 11:51:11 -10:00
ItemType.pm Bug 29844: Some more uncaught cases 2022-02-09 15:36:23 -10:00
ItemTypes.pm
KeyboardShortcut.pm
KeyboardShortcuts.pm
Libraries.pm
Library.pm Bug 28948: (QA follow-up) Convert to allow-list 2021-10-28 17:32:34 +02:00
Linktracker.pm
Localization.pm
Localizations.pm
Logger.pm
Manual.pm
MarcOverlayRule.pm Bug 14957: (QA follow-up) Rename 'merge' => 'overlay' 2021-10-26 16:46:02 +02:00
MarcOverlayRules.pm Bug 14957: Fix field order issue 2021-10-26 16:46:03 +02:00
MarcSubfieldStructure.pm
MarcSubfieldStructures.pm
MessageAttribute.pm
MessageAttributes.pm
MetadataIterator.pm
MetadataRecord.pm
MetaSearcher.pm
MoreUtils.pm
OAuth.pm
OAuthAccessToken.pm
OAuthAccessTokens.pm
Object.pm Bug 29785: Rename Koha::Object->message with ->object_messages 2022-02-09 22:01:36 -10:00
Objects.pm Bug 29844: Remove use of wantarray from Koha::Objects 2022-02-09 15:36:23 -10:00
Patron.pm Bug 29230: Add Koha::Patron->messages 2022-02-09 22:01:36 -10:00
Patrons.pm Bug 29984: Remove unused method Koha::Patrons->anonymise_issue_history 2022-02-10 14:44:23 -10:00
Plugins.pm
ProblemReport.pm
ProblemReports.pm
PseudonymizedTransaction.pm
PseudonymizedTransactions.pm
Quote.pm
Quotes.pm
Rating.pm
Ratings.pm
RDF.pm
RecordProcessor.pm
Report.pm
Reports.pm
Review.pm
Reviews.pm
Schema.pm
Script.pm
SearchEngine.pm
SearchField.pm
SearchFields.pm
SearchMarcMap.pm
SearchMarcMaps.pm
Serial.pm
Serials.pm
SharedContent.pm
SimpleMARC.pm
Sitemapper.pm
Statistic.pm
Statistics.pm
StockRotationItem.pm Bug 29809: Rename item relation accessor from itemnumber 2022-01-31 21:55:40 -10:00
StockRotationItems.pm
StockRotationRota.pm
StockRotationRotas.pm
StockRotationStage.pm
StockRotationStages.pm
Subscription.pm
Subscriptions.pm
Suggestion.pm Bug 17314: Implement /suggestions routes 2021-10-28 17:32:34 +02:00
SuggestionEngine.pm
Suggestions.pm
Tag.pm
Tags.pm
Token.pm Bug 29543: Add JWT token handling 2022-02-02 21:05:29 -10: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 Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
Virtualshelf.pm Bug 28959: Add virtualshelves.public as a boolean 2021-10-28 17:47:38 +02:00
Virtualshelfcontent.pm
Virtualshelfcontents.pm
Virtualshelfshare.pm
Virtualshelfshares.pm
Virtualshelves.pm Bug 28959: Add virtualshelves.public as a boolean 2021-10-28 17:47:38 +02:00
Z3950Responder.pm
Z3950Server.pm
Z3950Servers.pm