From 74055be78f46fd4997eee160a092fd7e117b6c45 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Mon, 20 Dec 2010 14:36:21 +0100 Subject: po plugin: update injected urlto signature. The lack of $from will probably hurt setups using po_link_to = current, but at least we can fix the blocker bug that prevents any wiki using the po plugin to build. --- IkiWiki/Plugin/po.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 79142ed1f..a142bb909 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -635,7 +635,7 @@ sub mytargetpage ($$) { return $origsubs{'targetpage'}->($page, $ext); } -sub myurlto ($$;$) { +sub myurlto ($;$$) { my $to=shift; my $from=shift; my $absolute=shift; @@ -644,7 +644,12 @@ sub myurlto ($$;$) { if (! length $to && $config{po_link_to} eq "current" && istranslatable('index')) { - return IkiWiki::beautify_urlpath(IkiWiki::baseurl($from) . "index." . lang($from) . ".$config{htmlext}"); + if (defined $from) { + return IkiWiki::beautify_urlpath(IkiWiki::baseurl($from) . "index." . lang($from) . ".$config{htmlext}"); + } + else { + return $origsubs{'urlto'}->($to,$from,$absolute); + } } # avoid using our injected beautify_urlpath if run by cgi_editpage, # so that one is redirected to the just-edited page rather than to the -- cgit v1.2.3 From 406485917af781a63607b50414bbf0d2e479da5f Mon Sep 17 00:00:00 2001 From: intrigeri Date: Wed, 22 Dec 2010 12:55:33 +0100 Subject: po: do not override homepage title when it was overridden. --- IkiWiki/Plugin/po.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index a142bb909..9ed4a1adb 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -367,7 +367,8 @@ sub pagetemplate (@) { && $masterpage eq "index") { $template->param('parentlinks' => []); } - if (ishomepage($page) && $template->query(name => "title")) { + if (ishomepage($page) && $template->query(name => "title") + && !$template->param("title_overridden")) { $template->param(title => $config{wikiname}); } } -- cgit v1.2.3 From b2a2246bac236cbe059042482828e68413597fd8 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Wed, 22 Dec 2010 19:21:41 +0100 Subject: Enable HTML::Template's parent_global_vars option. Else setting parameters that do not appear in the template (such as title_overridden) fails horribly. --- IkiWiki.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/IkiWiki.pm b/IkiWiki.pm index 97946bfcf..926d42a49 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1891,6 +1891,7 @@ sub template_depends ($$;@) { }, loop_context_vars => 1, die_on_bad_params => 0, + parent_global_vars => 1, filename => $filename, @_, ($untrusted ? (no_includes => 1) : ()), -- cgit v1.2.3