meta: Fix bug in loading of HTML::Entities that can break inline archive=yes (mostly...
authorJoey Hess <joey@kitenet.net>
Tue, 12 Apr 2011 16:30:24 +0000 (12:30 -0400)
committerJoey Hess <joey@kitenet.net>
Tue, 12 Apr 2011 16:30:24 +0000 (12:30 -0400)
IkiWiki/Plugin/meta.pm
debian/changelog
doc/bugs/inline_archive_crash.mdwn [new file with mode: 0644]

index eebe3460f07a42ab2841aadcb08190fe02ae566f..434fde527eec42304f08e28435b103b22666f0d4 100644 (file)
@@ -300,7 +300,8 @@ sub pagetemplate (@) {
                $template->param(meta => join("\n", grep { (! $seen{$_}) && ($seen{$_}=1) } @{$metaheaders{$page}}));
        }
        if (exists $pagestate{$page}{meta}{title} && $template->query(name => "title")) {
-               $template->param(title => HTML::Entities::encode_numeric($pagestate{$page}{meta}{title}));
+               eval q{use HTML::Entities};
+               $template->param(title => encode_numeric($pagestate{$page}{meta}{title}));
                $template->param(title_overridden => 1);
        }
 
@@ -315,7 +316,8 @@ sub pagetemplate (@) {
        }
 
        foreach my $field (qw{description}) {
-               $template->param($field => HTML::Entities::encode_numeric($pagestate{$page}{meta}{$field}))
+               eval q{use HTML::Entities};
+               $template->param($field => encode_numeric($pagestate{$page}{meta}{$field}))
                        if exists $pagestate{$page}{meta}{$field} && $template->query(name => $field);
        }
 
index dffad9aec54bf0f53b2a5bf624c1220a27aec1b5..51c426df4271c3b61e266b0d1f438d3e3a99b0f4 100644 (file)
@@ -8,6 +8,8 @@ ikiwiki (3.20110329) UNRELEASED; urgency=low
   * Recommend libgravatar-url-perl, which contains Libravatar::URL.
   * monotone: Implement rcs_getmtime, and work around a problem with monotone
     0.48 that affects rcs_getctime. (Thanks, Richard Levitte)
+  * meta: Fix bug in loading of HTML::Entities that can break inline
+    archive=yes (mostly masked by other plugins that load the module).
 
  -- Joey Hess <joeyh@debian.org>  Mon, 28 Mar 2011 13:08:23 -0400
 
diff --git a/doc/bugs/inline_archive_crash.mdwn b/doc/bugs/inline_archive_crash.mdwn
new file mode 100644 (file)
index 0000000..a1139a9
--- /dev/null
@@ -0,0 +1,6 @@
+       \[[!inline Error: Undefined subroutine &HTML::Entities::encode_numeric called at /usr/share/perl5/IkiWiki/Plugin/meta.pm line 292.]]
+
+This occurred when recentchanges was disabled and building a change
+to a page that inlined other pages with archive=yes. I have
+committed a fix; filing a bug since the fix won't be landing in Debian stable any
+time soon. [[done]] --[[Joey]]