As I suggested when reviewing Will's code, calling loadindex() should be
sufficient.
sub import {
hook(type => "getsetup", id => "getsource", call => \&getsetup);
hook(type => "pagetemplate", id => "getsource", call => \&pagetemplate);
sub import {
hook(type => "getsetup", id => "getsource", call => \&getsetup);
hook(type => "pagetemplate", id => "getsource", call => \&pagetemplate);
- hook(type => "sessioncgi", id => "getsource", call => \&cgi_getsource);
+ hook(type => "cgi", id => "getsource", call => \&cgi_getsource);
-sub cgi_getsource ($$) {
# Note: we use sessioncgi rather than just cgi
# because we need $IkiWiki::pagesources{} to be
# Note: we use sessioncgi rather than just cgi
# because we need $IkiWiki::pagesources{} to be
my $page=$cgi->param('page');
my $page=$cgi->param('page');
+ IkiWiki::loadindex();
+
if ($IkiWiki::pagesources{$page}) {
my $data = IkiWiki::readfile(IkiWiki::srcfile($IkiWiki::pagesources{$page}));
if ($IkiWiki::pagesources{$page}) {
my $data = IkiWiki::readfile(IkiWiki::srcfile($IkiWiki::pagesources{$page}));