Bugzilla – Attachment 74286 Details for
Bug 20592
updateitem.pl causes database errors when empty non-public item notes updated
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20592 - updateitem.pl causes database errors when empty non-public item notes updated
Bug-20592---updateitempl-causes-database-errors-wh.patch (text/plain), 1.47 KB, created by
David Cook
on 2018-04-17 02:52:29 UTC
(
hide
)
Description:
Bug 20592 - updateitem.pl causes database errors when empty non-public item notes updated
Filename:
MIME Type:
Creator:
David Cook
Created:
2018-04-17 02:52:29 UTC
Size:
1.47 KB
patch
obsolete
>From f11072d4db5881ec9a7ef790874b963cc503dbea Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Tue, 17 Apr 2018 12:48:23 +1000 >Subject: [PATCH] Bug 20592 - updateitem.pl causes database errors when empty > non-public item notes updated > >Previously, clicking "Update" next to non-public item note when the text >box was empty would generate a database error. > >This patches adds a condition where ModItem() is only called >if there are actual changes to be made to the record. > >_TEST PLAN_ >1) Create a bibliographic record >2) Create an item for that bib record >3) Go to /cgi-bin/koha/catalogue/moredetail.pl?biblionumber=1&itemnumber=1 >4) Click "Update" next to "Non-public note" >5) Note a "DBD::mysql::st execute failed" error in your logs > >6) Apply patch > >7) Click "Update" next to "Non-public note" >8) Note that there is no longer an error >9) Add text to the box and click "Update" to ensure update still works >--- > catalogue/updateitem.pl | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/catalogue/updateitem.pl b/catalogue/updateitem.pl >index b7cbc9445c..d969ac3cdc 100755 >--- a/catalogue/updateitem.pl >+++ b/catalogue/updateitem.pl >@@ -78,7 +78,9 @@ elsif (defined $itemnotes) { # i.e., itemnotes parameter passed from form > exit; > } > >-ModItem($item_changes, $biblionumber, $itemnumber); >+if ($biblionumber && $itemnumber && %$item_changes){ >+ ModItem($item_changes, $biblionumber, $itemnumber); >+} > > LostItem($itemnumber) if $itemlost; > >-- >2.13.6
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 20592
:
74286
|
74399
|
74400
|
74824
|
74825
|
74826
|
78453
|
78454
|
80728
|
80731
|
80732