% if ( ref $document && $document->id ) { % my $image = $document->get_image ('picture'); % if ( ref $image && exists $image->{filename} ) { % } % } <%args> $store => undef <%init> my $document; if ( $store ) { if ( $ARGS{picture} ) { $document = promosuite::Postcard->new ($keeper); my @properties = $document->structure(); my ($prop) = grep { $_->{attr} eq 'picture' } @properties; my $IMG = $document->get_image ('picture'); my $IMAGE = $m->comp ('/subs/set_image.msn', field => 'picture', object => $document, prop => $prop, default => $IMG, SETS => \%ARGS, ); if (ref $IMAGE && exists($IMAGE->{filename})) { local $Data::Dumper::Indent = 0; $document->picture( Data::Dumper::Dumper($IMAGE) ); $document->store; } } } return unless ref $document && $document->id;