EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #05224


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

[EP-tech] undefined value error


Has anyone seen / solved an issue like this?

 

I’m building a command-line routine (in 3.3.10) to update a new field on eprints. The field exists in the dataset, as seen in MySQL workbench.

It works fine for most of the eprints I’m updating, but some of them cause the routine to fail with the following message:

 

Can't call method "current_repository" on an undefined value at /opt/eprints3/perl_lib/EPrints/BackCompatibility.pm line 443.

 

 

My raft of debug statements have narrowed it down to a call to $eprint->commit;

 

my $eprint = $repository->eprint($eprint_id);

if (defined($eprint))

{

$eprint->set_value ("new_field_name", “a value");

print STDERR "debug 4, ".$eprint->get_value("new_field_name").", ";

$eprint->commit ;

print STDERR "debug 5\n";

}

 

And the output on STDERR is

 

debug 4, a value, Can't call method "current_repository" on an undefined value at /opt/eprints3/perl_lib/EPrints/BackCompatibility.pm line 443.

 

Any clues?  This is on a dev server, so something might be missing from another table?  Everything looks the same in the eprints table as records that worked.

-- The Open University is incorporated by Royal Charter (RC 000391), an exempt charity in England & Wales and a charity registered in Scotland (SC 038302). The Open University is authorised and regulated by the Financial Conduct Authority.