hook(type => "getsetup", id => "edittemplate",
call => \&getsetup);
hook(type => "needsbuild", id => "edittemplate",
hook(type => "getsetup", id => "edittemplate",
call => \&getsetup);
hook(type => "needsbuild", id => "edittemplate",
- my $link=IkiWiki::linkpage($params{template});
- $pagestate{$params{page}}{edittemplate}{$params{match}}=$link;
+ my $link=linkpage($params{template});
+ my $bestlink=bestlink($params{page}, $link);
+ $pagestate{$params{page}}{edittemplate}{$params{match}}=$bestlink;
return sprintf(gettext("edittemplate %s registered for %s"),
htmllink($params{page}, $params{destpage}, $link),
$params{match});
return sprintf(gettext("edittemplate %s registered for %s"),
htmllink($params{page}, $params{destpage}, $link),
$params{match});
- 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}) {
foreach my $p (@page_locs) {
foreach my $registering_page (keys %pagestate) {
if (exists $pagestate{$registering_page}{edittemplate}) {