Bug 37540

Summary: Pseudonymization is preventing renewals from the patrons account page
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: CirculationAssignee: Nick Clemens (kidclamp) <nick>
Status: Pushed to stable --- QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: critical    
Priority: P5 - low CC: gmcharlt, kyle.m.hall, lucas, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00,24.05.06
Circulation function:
Bug Depends on:    
Bug Blocks: 37558    
Attachments: Bug 37540: Ensure datetime is a string before enqueueing pseudonymization
Bug 37540: Ensure datetime is a string before enqueueing pseudonymization
Bug 37540: Ensure datetime is a string before enqueueing pseudonymization

Description Nick Clemens (kidclamp) 2024-07-31 17:00:52 UTC
To recreate:
1 - Enable Pseudonymization in system preferences
    NOTE: See bug 28911 to setup bcrypt value in koha conf
2 - Checkout an item to a patron
3 - From the checkouts page, check the box for the checkout under renewals
4 - Click the 'Renew selected items' button
5 - Internal server error:

==> /var/log/koha/kohadev/plack-error.log <==
{UNKNOWN}: encountered object '2024-07-31T16:56:36', but neither allow_blessed, convert_blessed nor allow_tags settings are enabled (or TO_JSON/FREEZE method missing) at /kohadevbox/koha/Koha/BackgroundJob.pm line 108. at /kohadevbox/koha/C4/Circulation.pm line 3411
Comment 1 Nick Clemens (kidclamp) 2024-07-31 17:26:55 UTC
Created attachment 169907 [details] [review]
Bug 37540: Ensure datetime is a string before enqueueing pseudonymization

To test:
1 - Enable Pseudonymization in system preferences
    NOTE: See bug 28911 for bcrypt setup
2 - Issue an item to a patron
3 - View the patrons checkouts
4 - Check the box under 'Renew'
5 - Renew selected items
6 - Internal server error
7 - Apply patch
8 - Restart all
9 - Repeat 4&5
10 - Success!
Comment 2 Nick Clemens (kidclamp) 2024-07-31 18:54:11 UTC
Libraries report this is actually blocking all circulations
Comment 3 Roman Dolny 2024-07-31 18:54:38 UTC
Created attachment 169911 [details] [review]
Bug 37540: Ensure datetime is a string before enqueueing pseudonymization

To test:
1 - Enable Pseudonymization in system preferences
    NOTE: See bug 28911 for bcrypt setup
2 - Issue an item to a patron
3 - View the patrons checkouts
4 - Check the box under 'Renew'
5 - Renew selected items
6 - Internal server error
7 - Apply patch
8 - Restart all
9 - Repeat 4&5
10 - Success!

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 4 Martin Renvoize (ashimema) 2024-08-01 10:51:33 UTC
Created attachment 169931 [details] [review]
Bug 37540: Ensure datetime is a string before enqueueing pseudonymization

To test:
1 - Enable Pseudonymization in system preferences
    NOTE: See bug 28911 for bcrypt setup
2 - Issue an item to a patron
3 - View the patrons checkouts
4 - Check the box under 'Renew'
5 - Renew selected items
6 - Internal server error
7 - Apply patch
8 - Restart all
9 - Repeat 4&5
10 - Success!

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Katrin Fischer 2024-08-01 15:46:34 UTC
Happy to push as is, but should we have a bug for adding a primary key to statistics?
Comment 6 Katrin Fischer 2024-08-01 16:27:46 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 7 Nick Clemens (kidclamp) 2024-08-01 22:04:49 UTC
(In reply to Katrin Fischer from comment #5)
> Happy to push as is, but should we have a bug for adding a primary key to
> statistics?

I didn't consider it largely because of the cost of the update for systems with lots of statistics, but it might be worth filing for discussion
Comment 8 Katrin Fischer 2024-08-02 09:44:44 UTC
(In reply to Nick Clemens (kidclamp) from comment #7)
> (In reply to Katrin Fischer from comment #5)
> > Happy to push as is, but should we have a bug for adding a primary key to
> > statistics?
> 
> I didn't consider it largely because of the cost of the update for systems
> with lots of statistics, but it might be worth filing for discussion

Yes, I think let's discuss it at least. I believe it probably also makes other things harder.
Comment 9 Lucas Gass (lukeg) 2024-11-18 18:40:51 UTC
Backported to 24.05.x for upcoming 24.05.06