X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/bb93fccf0690344aa77f9538a508959a6de09847..b7d50abc0f3dbe99d2a3664c12ea95d24bfcf04b:/IkiWiki/Plugin/edittemplate.pm diff --git a/IkiWiki/Plugin/edittemplate.pm b/IkiWiki/Plugin/edittemplate.pm index 7c0e7c2f8..5f0551d92 100644 --- a/IkiWiki/Plugin/edittemplate.pm +++ b/IkiWiki/Plugin/edittemplate.pm @@ -3,7 +3,7 @@ package IkiWiki::Plugin::edittemplate; use warnings; use strict; -use IkiWiki 2.00; +use IkiWiki 3.00; use HTML::Template; use Encode; @@ -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}) {