Bug 39226

Summary: [WARN] DBIx::Class::Storage::DBI::insert(): Missing value for primary key column 'borrowernumber' on BorrowerModification
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: PatronsAssignee: Marcel de Rooy <m.de.rooy>
Status: Pushed to main --- QA Contact: Emily Lamancusa (emlam) <emily.lamancusa>
Severity: minor    
Priority: P5 - low CC: emily.lamancusa, gmcharlt, kyle.m.hall, paul.derscheid
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
25.05.00
Circulation function:
Attachments: Bug 39226: Add borrowernumber 0 when creating patron modification
Bug 39226: Add borrowernumber 0 when creating patron modification
Bug 39226: (follow-up) Similar change for the cud-update branch
Bug 39226: (follow-up) Similar change for the cud-update branch
Bug 39226: Add borrowernumber 0 when creating patron modification
Bug 39226: (follow-up) Similar change for the cud-update branch
Bug 39226: Add borrowernumber 0 when creating patron modification
Bug 39226: (follow-up) Similar change for the cud-update branch

Description Marcel de Rooy 2025-03-03 13:06:09 UTC
Seeing this one in 23.11. Not seen before in 22.11.

[2025/02/28 10:20:09] [WARN] DBIx::Class::Storage::DBI::insert(): Missing value for primary key column 'borrowernumber' on BorrowerModification - perhaps you forgot to set its 'is_auto_increment' attribute during add_columns()? Treating 'borrowernumber' implicitly as an autoinc, and attempting value retrieval at /usr/share/koha/Koha/Object.pm line 172

Coming from opac-memberentry.pl when storing Koha::Patron::Modification in the create step.
Probably adding a borrowernumber 0 in the hash should be enough to get rid of this probably innocent warning?
Comment 1 Marcel de Rooy 2025-03-03 13:12:42 UTC
Created attachment 178891 [details] [review]
Bug 39226: Add borrowernumber 0 when creating patron modification

Test plan:
Test with and without this patch. Verify that you see no warn with Missing
value for primary key column anymore in plack-opac-error.
Enable self registration.
Register a new patron.
Comment 2 Paul Derscheid 2025-03-31 09:32:54 UTC
It's weird, for some reason I can't reproduce this issue on main.
Comment 3 Marcel de Rooy 2025-03-31 09:38:48 UTC
(In reply to Paul Derscheid from comment #2)
> It's weird, for some reason I can't reproduce this issue on main.

What is value of PatronSelfRegistrationVerifyByEmail ?
Comment 4 Paul Derscheid 2025-03-31 09:47:12 UTC
Created attachment 179956 [details] [review]
Bug 39226: Add borrowernumber 0 when creating patron modification

Test plan:
Test with and without this patch. Verify that you see no warn with Missing
value for primary key column anymore in plack-opac-error.
Enable self registration.
Register a new patron.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Comment 5 Marcel de Rooy 2025-03-31 09:53:52 UTC
Created attachment 179965 [details] [review]
Bug 39226: (follow-up) Similar change for the cud-update branch

Resolve
DBIx::Class::Storage::DBI::insert(): Missing value for primary key column 'verification_token' on BorrowerModification

Test plan:
Update details for existing borrower.
Comment 6 Paul Derscheid 2025-03-31 10:22:38 UTC
I think it has to be 
`$borrower_changes{verification_token} = q{};`
instead, huh?
Comment 7 Marcel de Rooy 2025-03-31 10:43:40 UTC
Created attachment 179973 [details] [review]
Bug 39226: (follow-up) Similar change for the cud-update branch

Resolve
DBIx::Class::Storage::DBI::insert(): Missing value for primary key column 'verification_token' on BorrowerModification

Test plan:
Update details for existing borrower.
Comment 8 Marcel de Rooy 2025-03-31 10:44:12 UTC
(In reply to Paul Derscheid from comment #6)
> I think it has to be 
> `$borrower_changes{verification_token} = q{};`
> instead, huh?

Sure :) Copy and paste..
Comment 9 Paul Derscheid 2025-03-31 11:50:45 UTC
Created attachment 179981 [details] [review]
Bug 39226: Add borrowernumber 0 when creating patron modification

Test plan:
Test with and without this patch. Verify that you see no warn with Missing
value for primary key column anymore in plack-opac-error.
Enable self registration.
Register a new patron.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Comment 10 Paul Derscheid 2025-03-31 11:50:47 UTC
Created attachment 179982 [details] [review]
Bug 39226: (follow-up) Similar change for the cud-update branch

Resolve
DBIx::Class::Storage::DBI::insert(): Missing value for primary key column 'verification_token' on BorrowerModification

Test plan:
Update details for existing borrower.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Comment 11 Paul Derscheid 2025-03-31 11:51:54 UTC
Ah, sorry. Forgot that I already SOd.
Comment 12 Paul Derscheid 2025-03-31 11:52:30 UTC
But this is easily PQA, already tested everything.
Comment 13 Emily Lamancusa (emlam) 2025-03-31 12:44:21 UTC
Created attachment 180026 [details] [review]
Bug 39226: Add borrowernumber 0 when creating patron modification

Test plan:
Test with and without this patch. Verify that you see no warn with Missing
value for primary key column anymore in plack-opac-error.
Enable self registration.
Register a new patron.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Comment 14 Emily Lamancusa (emlam) 2025-03-31 12:44:23 UTC
Created attachment 180027 [details] [review]
Bug 39226: (follow-up) Similar change for the cud-update branch

Resolve
DBIx::Class::Storage::DBI::insert(): Missing value for primary key column 'verification_token' on BorrowerModification

Test plan:
Update details for existing borrower.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Comment 15 Marcel de Rooy 2025-03-31 12:51:02 UTC
(In reply to Emily Lamancusa (emlam) from comment #14)
> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>

Thx
Comment 16 Katrin Fischer 2025-04-11 07:55:57 UTC
Pushed for 25.05!

Well done everyone, thank you!