Bugzilla – Attachment 53779 Details for
Bug 14844
Corrupted storable string. When adding/editing an Item, cookie LastCreatedItem might be corrupted.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14844: Corrupted storable string. When adding/editing an Item, cookie LastCreatedItem might be corrupted.
Bug-14844-Corrupted-storable-string-When-addingedi.patch (text/plain), 2.29 KB, created by
Tomás Cohen Arazi (tcohen)
on 2016-07-28 14:35:10 UTC
(
hide
)
Description:
Bug 14844: Corrupted storable string. When adding/editing an Item, cookie LastCreatedItem might be corrupted.
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2016-07-28 14:35:10 UTC
Size:
2.29 KB
patch
obsolete
>From 6dd03e049f2ae9340445b669fd5107d634216738 Mon Sep 17 00:00:00 2001 >From: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> >Date: Thu, 17 Sep 2015 13:23:49 +0300 >Subject: [PATCH] Bug 14844: Corrupted storable string. When adding/editing an > Item, cookie LastCreatedItem might be corrupted. > >No idea how to replicate this issue but we have been getting several reports >about the following error: > >Software error: > >Corrupted storable string (binary v2.9) at /usr/lib/perl/5.18/Storable.pm line >417, at /home/koha/kohaclone/cataloguing/additem.pl line 375. > >TEST PLAN: >1. Add or modify an Item. >2. No observed changes. >?. We don't know what causes this but we know that add/modify Item occasionally > crashes due to failure of a cookie thawing. > >This patch prevents the whole program from dying, because this error is not >critical enough to warrant dying. >Also there is no centralized mechanism in Koha for showing messages to the >user, so there is no easy and convenient way to warn the user that the: >'LastCreatedItem'-cookie or the systempreference 'PrefillItem' is >malfunctioning. > >So we instead just warn to the server logs with the malfunctioning cookie in >hopes of nailing down what causes the issues. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > cataloguing/additem.pl | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index b3474f6..b896b0b 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -417,9 +417,15 @@ if ($prefillitem) { > my $lastitemcookie = $input->cookie('LastCreatedItem'); > if ($lastitemcookie) { > $lastitemcookie = uri_unescape($lastitemcookie); >- if ( thaw($lastitemcookie) ) { >- $cookieitemrecord = thaw($lastitemcookie) ; >- $cookieitemrecord = removeFieldsForPrefill($cookieitemrecord); >+ eval { >+ if ( thaw($lastitemcookie) ) { >+ $cookieitemrecord = thaw($lastitemcookie); >+ $cookieitemrecord = removeFieldsForPrefill($cookieitemrecord); >+ } >+ }; >+ if ($@) { >+ $lastitemcookie = 'undef' unless $lastitemcookie; >+ warn "Storable::thaw failed to thaw LastCreatedItem-cookie. Cookie value '$lastitemcookie'. Caught error follows: '$@'"; > } > } > } >-- >2.9.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 14844
:
42644
|
53779
|
53833