Bugzilla – Attachment 183538 Details for
Bug 39871
Cannot clear item statuses with batch item modification tool
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39871: Don't pass undef for non-nullable fields from batch mod tool
Bug-39871-Dont-pass-undef-for-non-nullable-fields-.patch (text/plain), 1.87 KB, created by
David Flater
on 2025-06-26 14:38:12 UTC
(
hide
)
Description:
Bug 39871: Don't pass undef for non-nullable fields from batch mod tool
Filename:
MIME Type:
Creator:
David Flater
Created:
2025-06-26 14:38:12 UTC
Size:
1.87 KB
patch
obsolete
>From 93413ba6aae8a50d47e5c177227e832e8bb012a9 Mon Sep 17 00:00:00 2001 >From: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> >Date: Wed, 25 Jun 2025 12:53:02 -0400 >Subject: [PATCH] Bug 39871: Don't pass undef for non-nullable fields from > batch mod tool > >To test: >1. Set not-for-loan, withdrawn, and damaged statuses on some items >2. Try to edit only those items with the Batch item modification tool >3. Check the checkboxes to clear the withdrawn, not-for-loan, and damaged statuses >4. Click Save >5. View the background job report >--> Note that it says the items could not be modified >6. Look at the items >--> The statuses have not been cleared >7. Apply patch and restart_all >8. Repeat steps 2-5 >--> The background job report says the modifications were successful >9. View the items >--> The statuses have been cleared > >Signed-off-by: David Flater <flaterdavid@gmail.com> >--- > tools/batchMod.pl | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > >diff --git a/tools/batchMod.pl b/tools/batchMod.pl >index 92f19d2929..64892af373 100755 >--- a/tools/batchMod.pl >+++ b/tools/batchMod.pl >@@ -137,7 +137,13 @@ if ( $op eq "cud-action" ) { > if ( grep { $cgi_var_name eq $_ } @subfields_to_blank ) { > > # Empty this column >- $new_item_data->{$attr} = undef; >+ if ( $attr eq 'withdrawn' || $attr eq 'itemlost' || $attr eq 'damaged' || $attr eq 'notforloan' ) { >+ >+ # these fields are not nullable; they must be set to 0 instead >+ $new_item_data->{$attr} = 0; >+ } else { >+ $new_item_data->{$attr} = undef; >+ } > } elsif ( my $regex_search = $input->param( $cgi_var_name . '_regex_search' ) ) { > $columns_with_regex->{$attr} = { > search => $regex_search, >-- >2.39.5
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 39871
:
183522
|
183538
|
183549
|
183591
|
183592
|
183596