Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion perl_lib/EPrints/Apache/CRUD.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ sub parse_input
}
elsif( $count == 0 || ( $list->count == 0 && $self->{method} ne "PUT" && $self->{method} ne "PATCH" ) )
{
$plugin->handler->message( "error", "Import plugin didn't create anything" );
$plugin->handler->message( "error", "Import plugin didn't create anything. Check ".$repo->config( 'perl_url' )."/schema to ensure the metadata being sent is valid." );
$self->plugin_error( $plugin, \@messages );
return undef;
}
Expand Down
10 changes: 9 additions & 1 deletion perl_lib/EPrints/Database.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1911,7 +1911,15 @@ sub add_record
}

# Now add the ACTUAL data:
return $self->update( $dataset, $data, $data );
my $rc = $self->update( $dataset, $data, $data );

# If the update failed then delete the empty record created by the earlier insert
if ( !$rc )
{
$self->remove( $dataset, $id );
}

return $rc;
}


Expand Down