From 73f4a8835876c8cb07808367cd72d9ae972893e8 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 9 Jan 2010 22:54:34 +0100 Subject: [PATCH] po: inject custom isselflink to fix selflink detection on translation pages --- IkiWiki/Plugin/po.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 02fc4a89e..bbbb3b870 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -63,6 +63,8 @@ sub import { inject(name => "IkiWiki::cgiurl", call => \&mycgiurl); $origsubs{'rootpage'}=\&IkiWiki::rootpage; inject(name => "IkiWiki::rootpage", call => \&myrootpage); + $origsubs{'isselflink'}=\&IkiWiki::isselflink; + inject(name => "IkiWiki::isselflink", call => \&myisselflink); } @@ -671,6 +673,17 @@ sub myrootpage (@) { return $rootpage; } +sub myisselflink ($$) { + my $page=shift; + my $link=shift; + + return 1 if $origsubs{'isselflink'}->($page, $link); + if (istranslation($page)) { + return $origsubs{'isselflink'}->(masterpage($page), $link); + } + return; +} + # ,---- # | Blackboxes for private data # `---- -- 2.26.2