Bug 20971 - Corrupted storable string breaks SubfieldsToUseWhenPrefill functionality
Summary: Corrupted storable string breaks SubfieldsToUseWhenPrefill functionality
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: paxed
QA Contact: Testopia
URL:
Keywords: Academy
Depends on:
Blocks:
 
Reported: 2018-06-21 08:25 UTC by paxed
Modified: 2022-06-06 20:24 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.02


Attachments
Perl script to demonstrate uri (un)escape problem and base64url correctness (967 bytes, application/x-perl)
2018-06-21 08:26 UTC, paxed
Details
Bug 20971: additem Corrupted storable string (2.41 KB, patch)
2018-06-21 08:28 UTC, paxed
Details | Diff | Splinter Review
Bug 20971: additem Corrupted storable string (2.46 KB, patch)
2021-01-18 23:13 UTC, James O'Keeffe
Details | Diff | Splinter Review
Bug 20971: additem Corrupted storable string (2.51 KB, patch)
2021-01-18 23:26 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 20971: Prevent Storable::thaw to fail on LastCreatedItem (3.00 KB, patch)
2021-01-19 15:02 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description paxed 2018-06-21 08:25:08 UTC
Sometimes additem.pl will complain about "Storable::thaw failed to thaw LastCreatedItem-cookie.", see bug 14844. Now, actually fix the bug.
    
The bug is caused by trying to URI (un)escape MARC::Record, binary data.
We'll use a base64 url-safe version instead.
Comment 1 paxed 2018-06-21 08:26:47 UTC
Created attachment 76223 [details]
Perl script to demonstrate uri (un)escape problem and base64url correctness
Comment 2 paxed 2018-06-21 08:28:33 UTC
Created attachment 76224 [details] [review]
Bug 20971: additem Corrupted storable string

Sometimes additem.pl will complain about "Storable::thaw failed to
thaw LastCreatedItem-cookie.", see bug 14844. Now, actually fix the bug.

The bug is caused by trying to URI (un)escape MARC::Record, binary data.
We'll use a base64 url-safe version instead.
Comment 3 Michal Denar 2018-09-22 19:06:30 UTC
Hi,
some test plan?

Thanks

Mike
Comment 4 Hayley Pelham 2019-03-08 01:51:44 UTC
Bump, any test plan to follow for this?
Comment 5 Liz Rea 2019-04-30 00:45:53 UTC
Hi,

We can't test this without a plan, please provide one. :)

Cheers,
Liz
Comment 6 Didier Gautheron 2020-09-08 13:56:36 UTC
Hi

Without this patch  PrefillItem functionality is broken when adding unrelated items.

TEST:
1: Set PrefillItem to 'The new item is prefilled...'
2: Set a SubfieldsToUseWhenPrefill, 'c' for example
3: Add a new item for biblio A with 'c' set.
4: Double check 'c' value is set for next new item A.
5: search and add a new item for biblio B
6: 'c' is not set
Apply patch
7: logout, login
8: repeat steps 3, 4, and 5 .
9: now 'c' is set.
Comment 7 James O'Keeffe 2021-01-18 23:13:47 UTC
Created attachment 115257 [details] [review]
Bug 20971: additem Corrupted storable string

Sometimes additem.pl will complain about "Storable::thaw failed to
thaw LastCreatedItem-cookie.", see bug 14844. Now, actually fix the bug.

The bug is caused by trying to URI (un)escape MARC::Record, binary data.
We'll use a base64 url-safe version instead.

Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi>
Signed-off-by: James O'Keeffe <jamespfk@gmail.com>
Comment 8 Katrin Fischer 2021-01-18 23:26:23 UTC
We've recently also run into this in a workshop - glad to find a fix here!
Comment 9 Katrin Fischer 2021-01-18 23:26:58 UTC
Created attachment 115260 [details] [review]
Bug 20971: additem Corrupted storable string

Sometimes additem.pl will complain about "Storable::thaw failed to
thaw LastCreatedItem-cookie.", see bug 14844. Now, actually fix the bug.

The bug is caused by trying to URI (un)escape MARC::Record, binary data.
We'll use a base64 url-safe version instead.

Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi>
Signed-off-by: James O'Keeffe <jamespfk@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Katrin Fischer 2021-01-18 23:27:17 UTC
Thank you, James!
Comment 11 Jonathan Druart 2021-01-19 15:02:55 UTC
Created attachment 115332 [details] [review]
Bug 20971: Prevent Storable::thaw to fail on LastCreatedItem

Sometimes additem.pl will complain about "Storable::thaw failed to
thaw LastCreatedItem-cookie.", see bug 14844. Now, actually fix the bug.

The bug is caused by trying to URI (un)escape MARC::Record, binary data.
We'll use a base64 url-safe version instead.

Test plan:
1: Set PrefillItem to 'The new item is prefilled...'
2: Set a SubfieldsToUseWhenPrefill, 'c' for example
3: Add a new item for biblio A with 'c' set.
4: Double check 'c' value is set for next new item A.
5: search and add a new item for biblio B
6: 'c' is not set
Apply patch
7: logout, login
8: repeat steps 3, 4, and 5 .
9: now 'c' is set.

Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi>
Signed-off-by: James O'Keeffe <jamespfk@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

JD amended patch: fix commit title and add test plan
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 12 Jonathan Druart 2021-01-19 15:24:05 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 13 Fridolin Somers 2021-01-20 09:04:17 UTC
Pushed to 20.11.x for 20.11.02