po: guard against reimportation
If po is imported twice, bad things happen. Guard against that. I'm not sure what causes the double import; I saw it when websetup did a wiki rebuild. Carp failed to show a backtrace for the second call to import.master
parent
3f2f447cb5
commit
031da9c134
|
@ -51,6 +51,7 @@ sub import {
|
|||
hook(type => "formbuilder_setup", id => "po", call => \&formbuilder_setup, last => 1);
|
||||
hook(type => "formbuilder", id => "po", call => \&formbuilder);
|
||||
|
||||
if (! %origsubs) {
|
||||
$origsubs{'bestlink'}=\&IkiWiki::bestlink;
|
||||
inject(name => "IkiWiki::bestlink", call => \&mybestlink);
|
||||
$origsubs{'beautify_urlpath'}=\&IkiWiki::beautify_urlpath;
|
||||
|
@ -63,6 +64,7 @@ sub import {
|
|||
inject(name => "IkiWiki::cgiurl", call => \&mycgiurl);
|
||||
$origsubs{'rootpage'}=\&IkiWiki::rootpage;
|
||||
inject(name => "IkiWiki::rootpage", call => \&myrootpage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue