EPrints Technical Mailing List Archive

Message: #00999


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

[EP-tech] Empty eprints when clicked "new item" but then "cancel"


Hello,

I'd like to suggest that an eprint should be deleted right away if the user cancelled the workflow without filling in any required field, thus they won't clutter up their items page with spare entries to remove them by hand, just for convenience. I admit this case will not occur often once deployment is finished, but when it does, it can be quite annoying.

Or could that be done with eprint_fields_automatic callback?

$c->{eprint_fields_automatic} = sub {
     ...
     my %expected_fields = map { $_ => 1 } ...;
     my @set_fields = ...;
     defined || delete $expected_fields{$_} for @set_fields;
     $eprint->delete() if !%expected_fields;
}

Is deletion from within that callback safe and okay?

Regards,
Florian

--
UB Heidelberg (Altstadt)
Plöck 107-109, 69117 HD
- Informationstechnik
- WWW-Redaktion
http://www.ub.uni-heidelberg.de/