Bugzilla – Attachment 136401 Details for
Bug 29325
commit_file.pl error 'Already in a transaction'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29325: Fix import from staff client
Bug-29325-Fix-import-from-staff-client.patch (text/plain), 2.12 KB, created by
Martin Renvoize (ashimema)
on 2022-06-21 15:29:03 UTC
(
hide
)
Description:
Bug 29325: Fix import from staff client
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-06-21 15:29:03 UTC
Size:
2.12 KB
patch
obsolete
>From e6bac3fc848014f8b772676e04c4bfd2c1d20344 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 1 Jun 2022 19:32:23 +0000 >Subject: [PATCH] Bug 29325: Fix import from staff client > >same test as before, but via the staff client > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > tools/manage-marc-import.pl | 30 +++++++++++++----------------- > 1 file changed, 13 insertions(+), 17 deletions(-) > >diff --git a/tools/manage-marc-import.pl b/tools/manage-marc-import.pl >index e84178fe42..64e3180dfd 100755 >--- a/tools/manage-marc-import.pl >+++ b/tools/manage-marc-import.pl >@@ -235,21 +235,17 @@ sub commit_batch { > my ( $num_added, $num_updated, $num_items_added, > $num_items_replaced, $num_items_errored, $num_ignored ); > my $schema = Koha::Database->new->schema; >- $schema->storage->txn_do( >- sub { >- my $callback = sub { }; >- if ($runinbackground) { >- $job = put_in_background($import_batch_id); >- $callback = progress_callback( $job, $dbh ); >- } >- ( >- $num_added, $num_updated, $num_items_added, >- $num_items_replaced, $num_items_errored, $num_ignored >- ) >- = BatchCommitRecords( $import_batch_id, $framework, 50, >- $callback ); >- } >- ); >+ my $callback = sub { }; >+ if ($runinbackground) { >+ $job = put_in_background($import_batch_id); >+ $callback = progress_callback( $job ); >+ } >+ ( >+ $num_added, $num_updated, $num_items_added, >+ $num_items_replaced, $num_items_errored, $num_ignored >+ ) >+ = BatchCommitRecords( $import_batch_id, $framework, 50, >+ $callback ); > > my $results = { > did_commit => 1, >@@ -347,11 +343,11 @@ sub put_in_background { > > sub progress_callback { > my $job = shift; >- my $dbh = shift; > return sub { > my $progress = shift; >+ my $schema = shift; > $job->progress($progress); >- $dbh->commit(); >+ $schema->txn_commit; > } > } > >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29325
:
126944
|
127489
|
128033
|
135556
|
135557
|
135558
|
135559
|
135560
|
136390
|
136391
|
136392
|
136393
|
136394
|
136398
|
136399
|
136400
|
136401
|
136402
|
136478
|
136479
|
136480
|
136481
|
136482
|
136496
|
136497
|
136531
|
136803