From 26d9c08b93468e29c01f9a05c15299f9d7a47e1a Mon Sep 17 00:00:00 2001 From: David Cook Date: Thu, 13 Jul 2017 15:22:41 +1000 Subject: [PATCH] Use old style of UUID generation https://bugs.koha-community.org/show_bug.cgi?id=10662 --- Koha/OAI/Harvester/Worker/Download/Stream.pm | 7 +++++-- tools/oai-pmh-harvester/request.pl | 10 ++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Koha/OAI/Harvester/Worker/Download/Stream.pm b/Koha/OAI/Harvester/Worker/Download/Stream.pm index 03f64951b7..32276fd9bc 100644 --- a/Koha/OAI/Harvester/Worker/Download/Stream.pm +++ b/Koha/OAI/Harvester/Worker/Download/Stream.pm @@ -19,7 +19,7 @@ package Koha::OAI::Harvester::Worker::Download::Stream; use Modern::Perl; use LWP::UserAgent; -use UUID qw/uuid/; +use UUID; use POE; use JSON; use File::Path qw/make_path/; @@ -134,7 +134,10 @@ sub do_work { if ( ! -d $spooldir ){ my $made_spool_directory = make_path($spooldir); } - my $file_uuid = uuid(); + my ($uuid,$uuid_string); + UUID::generate($uuid); + UUID::unparse($uuid, $uuid_string); + my $file_uuid = $uuid_string; my $filename = "$spooldir/$file_uuid"; my $state = $document->toFile($filename, 2); if ($state){ diff --git a/tools/oai-pmh-harvester/request.pl b/tools/oai-pmh-harvester/request.pl index e980074d0e..db0356f745 100755 --- a/tools/oai-pmh-harvester/request.pl +++ b/tools/oai-pmh-harvester/request.pl @@ -18,7 +18,7 @@ # along with Koha; if not, see . use Modern::Perl; -use UUID qw/uuid/; +use UUID; use C4::Auth; use C4::Output; @@ -109,8 +109,10 @@ if ($op eq "new"){ } elsif ($op eq "create"){ if ($save){ - my $uuid = uuid; - $request->uuid($uuid); + my ($uuid,$uuid_string); + UUID::generate($uuid); + UUID::unparse($uuid, $uuid_string); + $request->uuid($uuid_string); $request->store; print $input->redirect('/cgi-bin/koha/tools/oai-pmh-harvester/dashboard.pl#saved_results'); exit; @@ -139,4 +141,4 @@ else { $template->{VARS}->{ op } = $op; $template->{VARS}->{ oai_pmh_request } = $request; -output_html_with_http_headers($input, $cookie, $template->output); \ No newline at end of file +output_html_with_http_headers($input, $cookie, $template->output); -- 2.12.3