X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/64370885cca3a37ee1f4a9e96673aca7ba5daae4..7aa10a2952a0d0ee8543f575966f7e4a780c993c:/IkiWiki/Plugin/edittemplate.pm diff --git a/IkiWiki/Plugin/edittemplate.pm b/IkiWiki/Plugin/edittemplate.pm index c7f1e4fa7..6e8c256da 100644 --- a/IkiWiki/Plugin/edittemplate.pm +++ b/IkiWiki/Plugin/edittemplate.pm @@ -130,13 +130,23 @@ sub filltemplate ($$) { $template=template("/".$template_page); }; if ($@) { + # gettext can clobber $@ + my $error = $@; # Indicate that the earlier preprocessor directive set # up a template that doesn't work. - return "[[!edittemplate ".gettext("failed to process template:")." $@]]"; + return "[[!edittemplate ".gettext("failed to process template:")." $error]]"; } $template->param(name => $page); + eval { + require UUID::Tiny; + UUID::Tiny->import(':std'); + my $uuid; + $uuid = create_uuid_as_string(UUID_V4()); + $template->param(uuid => $uuid); + }; + return $template->output; }