X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/fe1a69e11a16b337338593b784b48a4783de5cec..669a5f5ecc0d50daf96d8dc2af219c94c8625fb4:/IkiWiki/Plugin/inline.pm diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 0380bec3d..f578526cc 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -329,8 +329,12 @@ sub preprocess_inline (@) { my $ret=""; - if (length $config{cgiurl} && ! $params{preview} && (exists $params{rootpage} || - (exists $params{postform} && yesno($params{postform}))) && + my $postform = (exists $params{rootpage}); + if (exists $params{postform}) { + $postform = yesno($params{postform}); + } + + if (length $config{cgiurl} && ! $params{preview} && $postform && IkiWiki->can("cgi_editpage")) { # Add a blog post form, with feed buttons. my $formtemplate=template_depends("blogpost.tmpl", $params{page}, blind_cache => 1); @@ -391,7 +395,9 @@ sub preprocess_inline (@) { blind_cache => 1); }; if ($@) { - error sprintf(gettext("failed to process template %s"), $params{template}.".tmpl").": $@"; + # gettext can clobber $@ + my $error = $@; + error sprintf(gettext("failed to process template %s"), $params{template}.".tmpl").": $error"; } } my $needcontent=$raw || (!($archive && $quick) && $template->query(name => 'content'));