Bugzilla – Attachment 136160 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.73 KB, created by
David Nind
on 2022-06-16 12:59:40 UTC
(
hide
)
Description:
Bug 30972: Don't replace biblio's local cover images when uploading an image's image
Filename:
MIME Type:
Creator:
David Nind
Created:
2022-06-16 12:59:40 UTC
Size:
1.73 KB
patch
obsolete
>From 246ee74c54e9cf3ead959253480b795f62e88a12 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 > >Signed-off-by: David Nind <david@davidnind.com> >--- > 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 e533b8362d..4bd2e57e8f 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.30.2
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