Ticket #3540 (closed defect: fixed)

Opened 5 years ago

Last modified 3 years ago

Toolbox getEprintField doesn't work with subfields (but probably should?)

Reported by: tmb Owned by:
Priority: Customer Report Milestone: EPrints 3.2.10
Component: - Version:
Severity: normal Keywords:
Cc:

Description

...because Metafield::to_xml doesn't return anything if the field is a subfield (defined $field->{parent_name}).

Workaround:

sub tool_getEprintField
{
        my( %opts ) = @_;

        my @problems = ensure( \%opts, 'session', 'eprint', 'field' );
        return( 1, \@problems ) if( @problems );

        my $field = $opts{eprint}->get_dataset->get_field( $opts{field} );

        # don't ignore subfields
        delete $field->{parent_name} if defined $field->{parent_name};

Change History

Changed 3 years ago by sf03r@…

  • status changed from new to closed
  • resolution set to fixed

fixed in r7247 (3.3) + r7248 (3.2)

Note: See TracTickets for help on using tickets.