X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole.pm;h=fdb1b8659a493d76daad16232a65cf882ae36065;hb=c8353a63e48638b2f9cbf8bbc24c53825cc3212f;hp=bc41335cd5758aa76565f18c8670f29f2f5acff9;hpb=2c5d6782f89dc1532398b1b79c8f67b982c758ac;p=maypole.git diff --git a/lib/Maypole.pm b/lib/Maypole.pm index bc41335..fdb1b86 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -582,7 +582,11 @@ sub handler_guts { } # less frequent path - perhaps output has been set to an error message - return OK if $self->output; + if ($self->output) { + $self->{content_type} ||= $self->__get_mime_type(); + $self->{document_encoding} ||= "utf-8"; + return OK; + } # normal path - no output has been generated yet my $processed_view_ok = $self->__call_process_view; @@ -636,15 +640,16 @@ sub __setup_plain_template my ($self) = @_; # It's just a plain template + $self->build_form_elements(0); $self->model_class(undef); - # FIXME: this is likely to be redundant and is definately causing problems. - - my $path = $self->path; - $path =~ s{/$}{}; # De-absolutify - $self->path($path); - - $self->template($self->path); + unless ($self->template) { + # FIXME: this is likely to be redundant and is definately causing problems. + my $path = $self->path; + $path =~ s{/$}{}; # De-absolutify + $self->path($path); + $self->template($self->path); + } } # The model has been processed or skipped (if is_applicable returned false),