package importing fixes

This commit is contained in:
Graham Knop 2008-02-08 00:00:13 +00:00
parent 93b5ca16e4
commit f22646625b
9 changed files with 36 additions and 46 deletions

View file

@ -46,13 +46,15 @@ Override the default method in order to deal with attachments.
sub addRevision {
my $self = shift;
my $newSelf = $self->SUPER::addRevision(@_);
foreach my $field (qw(image1 image2 image3 brochure manual warranty)) {
if ($self->get($field)) {
my $newStorage = WebGUI::Storage->get($self->session,$self->get($field))->copy;
$newSelf->update({$field=>$newStorage->getId});
}
}
return $newSelf;
if ($newSelf->getRevisionCount > 1) {
foreach my $field (qw(image1 image2 image3 brochure manual warranty)) {
if ($self->get($field)) {
my $newStorage = WebGUI::Storage->get($self->session,$self->get($field))->copy;
$newSelf->update({$field=>$newStorage->getId});
}
}
}
return $newSelf;
}
#-------------------------------------------------------------------