From 21ca1e691caca5760196db21804977d3ed656c7d Mon Sep 17 00:00:00 2001 From: Dan Wells Date: Tue, 20 Nov 2018 12:33:49 -0500 Subject: [PATCH] LP#1804038 Fix-ups for older 'clense' functions Way back when, we switched from a misspelled 'clense_ISO8601' to a corrected 'cleanse_ISO8601' in OpenSRF. This function has again moved, and is now part of OpenILS::Utils::DateTime, and is named 'clean_ISO8601'. This was done as part of LP bug #1552778. However, a few stragglers of the misspelling remained, so these were missed when the big changeover occurred. This hopefully catches them all! Signed-off-by: Dan Wells Signed-off-by: Jason Boyer --- Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm | 4 ++-- Open-ILS/src/perlmods/lib/OpenILS/Application/Booking.pm | 2 +- Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm index 31e7083e50..c2b701a0c8 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm @@ -4064,7 +4064,7 @@ sub _reset_password_request { # Guard against no active requests if ($active_requests->[0]->{'request_time'}) { - my $last_request = DateTime::Format::ISO8601->parse_datetime(clense_ISO8601($active_requests->[0]->{'request_time'})); + my $last_request = DateTime::Format::ISO8601->parse_datetime(clean_ISO8601($active_requests->[0]->{'request_time'})); my $now = DateTime::Format::ISO8601->new(); # 3. if (num_active > throttle_threshold) and (now - last_request < 1 minute) @@ -4171,7 +4171,7 @@ sub commit_password_reset { # Ensure we're still within the TTL for the request my $aupr_ttl = $U->ou_ancestor_setting_value($user->home_ou, 'circ.password_reset_request_time_to_live') || 24*60*60; - my $threshold = DateTime::Format::ISO8601->parse_datetime(clense_ISO8601($aupr->[0]->request_time))->add(seconds => $aupr_ttl); + my $threshold = DateTime::Format::ISO8601->parse_datetime(clean_ISO8601($aupr->[0]->request_time))->add(seconds => $aupr_ttl); if ($threshold < DateTime->now(time_zone => 'local')) { $e->die_event; $logger->info("Password reset request needed to be submitted before $threshold"); diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Booking.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Booking.pm index d7ea2121d8..09680b8331 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Booking.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Booking.pm @@ -830,7 +830,7 @@ sub could_capture { $client->respond($bresv); } else { my $start_time = $dt_parser->parse_datetime( - clense_ISO8601($bresv->start_time) + clean_ISO8601($bresv->start_time) ); if ($now >= $start_time->subtract("seconds" => $elbow_room)) { diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm index fe509e9b93..d41c688564 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm @@ -77,7 +77,7 @@ sub _cleanse_dates { my $fields = shift; foreach my $field (@$fields) { - $item->$field(OpenSRF::Utils::clense_ISO8601($item->$field)) if $item->$field; + $item->$field(clean_ISO8601($item->$field)) if $item->$field; } return 0; } -- 2.43.2