X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/678d467a4080dd549f2b6f276f963eac384e1b4f..64946f91982d85bb301cc9241459939c657d0eb9:/IkiWiki/Plugin/edittemplate.pm diff --git a/IkiWiki/Plugin/edittemplate.pm b/IkiWiki/Plugin/edittemplate.pm index 0bafc95d0..5f0551d92 100644 --- a/IkiWiki/Plugin/edittemplate.pm +++ b/IkiWiki/Plugin/edittemplate.pm @@ -23,6 +23,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "web", }, } @@ -55,10 +56,11 @@ sub preprocess (@) { } my $link=linkpage($params{template}); - $pagestate{$params{page}}{edittemplate}{$params{match}}=$link; + my $bestlink=bestlink($params{page}, $link); + $pagestate{$params{page}}{edittemplate}{$params{match}}=$bestlink; return "" if ($params{silent} && IkiWiki::yesno($params{silent})); - add_depends($params{page}, $link); + add_depends($params{page}, $link, deptype("presence")); return sprintf(gettext("edittemplate %s registered for %s"), htmllink($params{page}, $params{destpage}, $link), $params{match}); @@ -82,10 +84,13 @@ sub formbuilder (@) { foreach my $field ($form->field) { if ($field eq 'page') { @page_locs=$field->def_value; - push @page_locs, $field->options; + + # FormBuilder is on the bad crack. See #551499 + my @options=map { ref $_ ? @$_ : $_ } $field->options; + + push @page_locs, @options; } } - foreach my $p (@page_locs) { foreach my $registering_page (keys %pagestate) { if (exists $pagestate{$registering_page}{edittemplate}) {