X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2FMaypole%2FModel%2FBase.pm;h=a9b3a32a7b9b57ccb6d13f652db6175a1b94fc48;hb=f7e68bd92b9b43454454f9715406b7e0f9b956e1;hp=9d673c61858c69061c5e24ab30c3c4be2a0c3849;hpb=344d21e842093ff5f863923abe65377999c12c8a;p=maypole.git diff --git a/lib/Maypole/Model/Base.pm b/lib/Maypole/Model/Base.pm index 9d673c6..a9b3a32 100644 --- a/lib/Maypole/Model/Base.pm +++ b/lib/Maypole/Model/Base.pm @@ -8,8 +8,16 @@ sub edit :Exported { } sub process { my ($class, $r) = @_; - $r->template( my $method = $r->action ); - $r->objects([ $class->retrieve(shift @{$r->{args}}) ]); + my $method = $r->action; + return if $r->{template}; # Authentication has set this, we're done. + + $r->{template} = $method; + $r->objects([]); + my $obj = $class->retrieve( $r->{args}->[0] ); + if ($obj) { + $r->objects([ $obj ]); + shift @{$r->{args}}; + } $class->$method($r); }