Bugzilla – Attachment 113920 Details for
Bug 26518
Adding a record can succeed even if adding the biblioitem fails
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26518: Move BiblioAutoLink within the transaction
Bug-26518-Move-BiblioAutoLink-within-the-transacti.patch (text/plain), 1.62 KB, created by
Nick Clemens (kidclamp)
on 2020-11-23 12:11:11 UTC
(
hide
)
Description:
Bug 26518: Move BiblioAutoLink within the transaction
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-11-23 12:11:11 UTC
Size:
1.62 KB
patch
obsolete
>From fd415023d54915aa3e7d21a88bf6a0795db270f9 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 12 Oct 2020 15:01:22 +0200 >Subject: [PATCH] Bug 26518: Move BiblioAutoLink within the transaction > >We don't want the authorities to be created if the biblio insert fails >later > >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > C4/Biblio.pm | 19 +++++++++---------- > 1 file changed, 9 insertions(+), 10 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 3fe8b38716..6e53842ee1 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -206,20 +206,19 @@ sub AddBiblio { > $defer_marc_save = 1; > } > >- if (C4::Context->preference('BiblioAddsAuthorities')) { >- BiblioAutoLink( $record, $frameworkcode ); >- } >- >- my ( $biblionumber, $biblioitemnumber, $error ); >- my $dbh = C4::Context->dbh; >- >- # transform the data into koha-table style data >- SetUTF8Flag($record); >- my $olddata = TransformMarcToKoha( $record, $frameworkcode ); > my $schema = Koha::Database->schema; >+ my ( $biblionumber, $biblioitemnumber ); > try { > $schema->txn_do(sub { > >+ if (C4::Context->preference('BiblioAddsAuthorities')) { >+ BiblioAutoLink( $record, $frameworkcode ); >+ } >+ >+ # transform the data into koha-table style data >+ SetUTF8Flag($record); >+ my $olddata = TransformMarcToKoha( $record, $frameworkcode ); >+ > my $biblio = Koha::Biblio->new( > { > frameworkcode => $frameworkcode, >-- >2.11.0
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 26518
:
110902
|
110903
|
111387
|
111389
|
111512
|
111513
|
111514
|
111515
|
113046
|
113671
|
113672
|
113673
|
113674
|
113917
|
113918
|
113919
| 113920 |
113921