Bugzilla – Attachment 168636 Details for
Bug 31143
We should attempt to fix/identify all cases where '0000-00-00' may still remain in the database
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31143: Update patrons with dates of 0000-00-00 to NULL
Bug-31143-Update-patrons-with-dates-of-0000-00-00-.patch (text/plain), 1.57 KB, created by
Wainui Witika-Park
on 2024-07-09 07:05:38 UTC
(
hide
)
Description:
Bug 31143: Update patrons with dates of 0000-00-00 to NULL
Filename:
MIME Type:
Creator:
Wainui Witika-Park
Created:
2024-07-09 07:05:38 UTC
Size:
1.57 KB
patch
obsolete
>From 51b75e633410ce95d14c591be0f7c817bb5dedc2 Mon Sep 17 00:00:00 2001 >From: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> >Date: Tue, 9 Jul 2024 18:16:31 +1200 >Subject: [PATCH] Bug 31143: Update patrons with dates of 0000-00-00 to NULL > >To test: >1) Change a patron's value of one or more of the following to >0000-00-00: dateofbirth dateenrolled dateexpiry date_renewed lastseen >updated_on debarred >2) Run the misc/maintenance/search_for_data_inconsistencies.pl script >3) Notice the value has changed from 0000-00-00 to NULL > >Sponsored by: Toi Ohomai Institute of Technology, New Zealand >--- > misc/maintenance/search_for_data_inconsistencies.pl | 10 ++++++++++ > 1 file changed, 10 insertions(+) > >diff --git a/misc/maintenance/search_for_data_inconsistencies.pl b/misc/maintenance/search_for_data_inconsistencies.pl >index 6719cecedc9..3c6012a07cd 100755 >--- a/misc/maintenance/search_for_data_inconsistencies.pl >+++ b/misc/maintenance/search_for_data_inconsistencies.pl >@@ -326,6 +326,16 @@ use C4::Biblio qw( GetMarcFromKohaField ); > } > } > >+{ >+ # search patrons that have date fields that are 0000-00-00 >+ foreach my $date_type (qw(dateofbirth dateenrolled dateexpiry date_renewed lastseen updated_on_debarred)) { >+ my $borrowers = Koha::Patrons->search( { $date_type=>'0000-00-00' } ); >+ while (my $borrower = $borrowers->next()) { >+ $borrower->$date_type(undef)->store(); >+ } >+ } >+} >+ > { > my @loop_borrowers_relationships; > my @guarantor_ids = Koha::Patron::Relationships->_resultset->get_column('guarantor_id')->all(); >-- >2.39.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 31143
:
154299
|
154399
|
155964
|
168636
|
168770
|
168775
|
168776
|
170086
|
170697
|
170698
|
171812
|
171813
|
171814
|
171815
|
171816
|
171817
|
171918
|
171976
|
171977
|
172138
|
172139
|
172140
|
172141
|
172143
|
172144
|
172145
|
172146
|
173900