X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/86660e9c82b67f9165cb5fabe28c341a338d8c4e..eba2dee941c18b3a1bd9c8af52c01ba7b5b46a64:/IkiWiki/Plugin/external.pm diff --git a/IkiWiki/Plugin/external.pm b/IkiWiki/Plugin/external.pm index ba6c7d8b9..4ce9c8bab 100644 --- a/IkiWiki/Plugin/external.pm +++ b/IkiWiki/Plugin/external.pm @@ -202,8 +202,16 @@ sub inject ($@) { #{{{ my $sub = sub { IkiWiki::Plugin::external::rpc_call($plugin, $params{call}, @_) }; + $sub=memoize($sub) if $params{memoize}; + + # This will add it to the symbol table even if not present. + no warnings; eval qq{*$params{name}=\$sub}; - memoize($params{name}) if $params{memoize}; + use warnings; + + # This will ensure that everywhere it was exported to sees + # the injected version. + IkiWiki::inject(name => $params{name}, call => $sub); return 1; } #}}}