Skip to content

Commit

Permalink
move the 'add_urn' functionality from a Catmandu::Fix to a LibreCat::…
Browse files Browse the repository at this point in the history
…Hook.

This is only used for registration at the German National Library, and as such
should be configurable.
  • Loading branch information
vpeil committed Sep 13, 2018
1 parent 3bb5b79 commit 4a44d03
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion fixes/update_publication.fix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ form2schema(publication_identifier)
form2schema(external_id)
page_range_number()
clean_preselects()
add_urn()
person()
volume_sort()

Expand Down
8 changes: 4 additions & 4 deletions lib/Catmandu/Fix/add_urn.pm → lib/LibreCat/Hook/add_urn.pm
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package Catmandu::Fix::add_urn;
package LibreCat::Hook::add_urn;

=pod
=head1 NAME
Catmandu::Fix::add_urn - create a urn field from the input data
LibreCat::Hook::add_urn - create a urn field from the input data
=cut

use Catmandu::Sane;
use LibreCat::App::Helper;
use LibreCat qw(config);
use Carp;
use Moo;

Expand All @@ -32,7 +32,7 @@ sub fix {

if ($oa and $pub->{type} ne 'research_data') {
$pub->{urn}
= $self->_generate_urn(h->config->{urn_prefix}, $pub->{_id});
= $self->_generate_urn(config->{urn_prefix}, $pub->{_id});
}
}

Expand Down
2 changes: 1 addition & 1 deletion t/Catmandu/Fix/add_urn.t → t/LibreCat/Hook/add_urn.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use LibreCat -load => {layer_paths => [qw(t/layer)]};
my $pkg;

BEGIN {
$pkg = 'Catmandu::Fix::add_urn';
$pkg = 'LibreCat::Hook::add_urn';
use_ok $pkg;
}
require_ok $pkg;
Expand Down

0 comments on commit 4a44d03

Please sign in to comment.