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

Florian Heß hess at ub.uni-heidelberg.de
Fri Aug 31 13:05:48 BST 2012


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/



More information about the Eprints-tech mailing list