X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/ef7bddbc3693d7abf227100a9a9bc21d186dfada..4ee754536d14610580f852d134a842c2cb9a1665:/IkiWiki/Plugin/edittemplate.pm diff --git a/IkiWiki/Plugin/edittemplate.pm b/IkiWiki/Plugin/edittemplate.pm index 7d2eba194..a163b0d84 100644 --- a/IkiWiki/Plugin/edittemplate.pm +++ b/IkiWiki/Plugin/edittemplate.pm @@ -55,7 +55,8 @@ 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, deptype("presence")); @@ -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}) {