Bugzilla – Attachment 136145 Details for
Bug 30972
"Replace existing covers" checkbox replaces ALL local covers for a biblio, not only the specific item's covers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30972: Don't replace biblio's local cover images when uploading an image's image
Bug-30972-Dont-replace-biblios-local-cover-images-.patch (text/plain), 1.68 KB, created by
Jonathan Druart
on 2022-06-16 10:32:55 UTC
(
hide
)
Description:
Bug 30972: Don't replace biblio's local cover images when uploading an image's image
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-06-16 10:32:55 UTC
Size:
1.68 KB
patch
obsolete
>From 5fdedbaec3aaa235bad18ab30f9a0e97b0e76917 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 16 Jun 2022 12:29:14 +0200 >Subject: [PATCH] Bug 30972: Don't replace biblio's local cover images when > uploading an image's image > >When attaching a new cover image to an item we should not replace cover >images attached to the bibliographic record if "Replace existing covers" >is ticked. > >Test plan: >Attach 1+ image to a bibliographic record >Attach 1 image to an item of this biblio >Attach another image to the item and seect "replace existing covers" >=> Without this patch the images attached to the biblio are removed >=> With this patch applied only the images attached to the image are >removed > >Same if you tick the checkbox when attaching an image to the biblio >--- > tools/upload-cover-image.pl | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > >diff --git a/tools/upload-cover-image.pl b/tools/upload-cover-image.pl >index e533b8362dc..4bd2e57e8f9 100755 >--- a/tools/upload-cover-image.pl >+++ b/tools/upload-cover-image.pl >@@ -107,10 +107,10 @@ if ($fileID) { > if ( defined $srcimage ) { > eval { > if ( $replace ) { >- if ( $biblionumber ) { >- Koha::Biblios->find($biblionumber)->cover_images->delete; >- } elsif ( $itemnumber ) { >+ if ( $itemnumber ) { > Koha::Items->find($itemnumber)->cover_images->delete; >+ } elsif ( $biblionumber ) { >+ Koha::Biblios->find($biblionumber)->cover_images->search({ itemnumber => undef })->delete; > } > } > >-- >2.25.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 30972
:
136145
|
136160
|
136322