X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/ce78b699278be0797316518079474bc776d657ed..11fc28970b329334d88d3667e5b55e0d57e353ab:/IkiWiki/Plugin/edittemplate.pm diff --git a/IkiWiki/Plugin/edittemplate.pm b/IkiWiki/Plugin/edittemplate.pm index 89d450725..a163b0d84 100644 --- a/IkiWiki/Plugin/edittemplate.pm +++ b/IkiWiki/Plugin/edittemplate.pm @@ -55,10 +55,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, content => 0); + 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 +83,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}) {