From c4b7642ff2102aeaf2986aad2f2f4b3fd1caf1d9 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 Signed-off-by: Ed Veal --- 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 03f6495..32276fd 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 e980074..db0356f 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.1.4