]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/aggregate.pm
Fix ugly display when editing a page that has vanished.
[git.ikiwiki.info.git] / IkiWiki / Plugin / aggregate.pm
index ba40ee6bcb42f57f2f3929db25a5f0fa75aeeb34..cb165acd2a0e7bb2c647d990d7723bf18a33b291 100644 (file)
@@ -5,9 +5,9 @@ package IkiWiki::Plugin::aggregate;
 use warnings;
 use strict;
 use IkiWiki 2.00;
 use warnings;
 use strict;
 use IkiWiki 2.00;
-use HTML::Entities;
 use HTML::Parser;
 use HTML::Tagset;
 use HTML::Parser;
 use HTML::Tagset;
+use HTML::Entities;
 use URI;
 use open qw{:utf8 :std};
 
 use URI;
 use open qw{:utf8 :std};
 
@@ -206,8 +206,6 @@ sub loadstate () { #{{{
 sub savestate () { #{{{
        return unless $state_loaded;
        garbage_collect();
 sub savestate () { #{{{
        return unless $state_loaded;
        garbage_collect();
-       eval q{use HTML::Entities};
-       error($@) if $@;
        my $newfile="$config{wikistatedir}/aggregate.new";
        my $cleanup = sub { unlink($newfile) };
        open (OUT, ">$newfile") || error("open $newfile: $!", $cleanup);
        my $newfile="$config{wikistatedir}/aggregate.new";
        my $cleanup = sub { unlink($newfile) };
        open (OUT, ">$newfile") || error("open $newfile: $!", $cleanup);
@@ -336,8 +334,6 @@ sub aggregate (@) { #{{{
        error($@) if $@;
        eval q{use URI::Fetch};
        error($@) if $@;
        error($@) if $@;
        eval q{use URI::Fetch};
        error($@) if $@;
-       eval q{use HTML::Entities};
-       error($@) if $@;
 
        foreach my $feed (@_) {
                $feed->{lastupdate}=time;
 
        foreach my $feed (@_) {
                $feed->{lastupdate}=time;
@@ -408,7 +404,7 @@ sub aggregate (@) { #{{{
                                title => defined $entry->title ? decode_entities($entry->title) : "untitled",
                                link => $entry->link,
                                content => defined $entry->content->body ? $entry->content->body : "",
                                title => defined $entry->title ? decode_entities($entry->title) : "untitled",
                                link => $entry->link,
                                content => defined $entry->content->body ? $entry->content->body : "",
-                               guid => defined $entry->id ? $entry->id : time."_".$feed->name,
+                               guid => defined $entry->id ? $entry->id : time."_".$feed->{name},
                                ctime => $entry->issued ? ($entry->issued->epoch || time) : time,
                        );
                }
                                ctime => $entry->issued ? ($entry->issued->epoch || time) : time,
                        );
                }