aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2014-02-23 16:03:44 +0000
committerSimon McVittie <smcv@debian.org>2014-07-04 23:23:42 +0100
commit0357ad66eaf739299db1df38bbddc289c561b034 (patch)
tree4696bb391b3dd2c2019600636ca69d28c121b6ee /IkiWiki
parent6d90e56c8dbb1e380f0e621305fd014767e9364b (diff)
downloadikiwiki-0357ad66eaf739299db1df38bbddc289c561b034.tar
ikiwiki-0357ad66eaf739299db1df38bbddc289c561b034.tar.gz
inline: postform=no should take precedence over rootpage existing
If someone has explicitly disabled the postform, it seems reasonable from a least-astonishment point of view for that to take precedence over rootpage, even though that makes rootpage useless. Also add a regression test; so far, this is all it tests.
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/inline.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
index 123dfd364..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);