EPrints Technical Mailing List Archive

Message: #04928


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] Re: citation modification


Hi Adam,

there's obviously something wrong, although I think to follow all your instructions :(

I modified eprint_fields.pl:
{
        name => 'creators',
        type => 'compound',
        multiple => 1,
        fields => [
                {
                        sub_name => 'name',
                        type => 'name',
                        hide_honourific => 1,
                        hide_lineage => 1,
                        family_first => 1,
                },
                {
                        sub_name => 'id',
                        type => 'text',
                        input_cols => 20,
                        allow_null => 1,
                }
        ],
        render_single_value => 'render_name_with_initials',
        input_boxes => 2,
},

I introduced eprint_render_single.pl:
print STDERR "It's Me :)\n";
$c->{render_name_with_initials} = sub
{
        print STDERR "It's You :)\n";
        my( $field, $repo, $value ) = @_;
        my $family = $value->{family};
        my $given = $value->{given};
        return $repo->xml->create_text_node( 'foo' );
}

I used Test.pl
#!/usr/bin/perl -I/opt/eprints3/perl_lib

use strict;
use warnings;
use EPrints;

my $ep = EPrints->new;
my $repo = $ep->repository('b40literatur');

my $eprint = $repo->dataset('eprint')->dataobj(3);

print STDERR EPrints::Utils::tree_to_utf8($eprint->render_value('creators'));

But I got finally for perl Test.pl 
It's Me :)
CreatorsEmailFoote, H.W.UNSPECIFIEDLevy, L.H.UNSPECIFIED

Thus my extra subroutine is never called even after apache's restart and database update?!

Thanks for any hint
Thomas