Fixes empty gd:* fields in get_events() result.

This is caused by an improper type casting from XML::Atom::Entry to Net::Google::Calendar::Entry.

PR:		99192
Submitted by:	maintainer
This commit is contained in:
Mathieu Arnold 2006-06-20 19:10:56 +00:00
parent 4f404ab5c2
commit 1e1b833fdf
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=165869
2 changed files with 38 additions and 0 deletions

View file

@ -7,6 +7,7 @@
PORTNAME= Net-Google-Calendar
DISTVERSION= 0.2_devel
PORTREVISION= 1
CATEGORIES= net perl5
MASTER_SITES= ${MASTER_SITE_PERL_CPAN}
MASTER_SITE_SUBDIR= Net

View file

@ -0,0 +1,37 @@
diff -ur lib/Net/Google/Calendar/Entry.pm lib/Net/Google/Calendar/Entry.pm
--- lib/Net/Google/Calendar/Entry.pm Thu Jun 15 17:42:23 2006
+++ lib/Net/Google/Calendar/Entry.pm Tue Jun 20 00:50:28 2006
@@ -45,10 +45,19 @@
my ($class, %opts) = @_;
my $self = $class->SUPER::new( Version => '1.0', %opts );
- $self->category('', { scheme => 'http://schemas.google.com/g/2005#kind', term => 'http://schemas.google.com/g/2005#event' } );
- $self->{_gd_ns} = XML::Atom::Namespace->new(gd => 'http://schemas.google.com/g/2005');
+ $self->_initialize();
+
return $self;
+}
+
+sub _initialize
+{
+ my $self = shift;
+
+ $self->category('', { scheme => 'http://schemas.google.com/g/2005#kind', term => 'http://schemas.google.com/g/2005#event' } );
+
+ $self->{_gd_ns} = XML::Atom::Namespace->new(gd => 'http://schemas.google.com/g/2005');
}
=head2 id [id]
diff -ur lib/Net/Google/Calendar.pm lib/Net/Google/Calendar.pm
--- lib/Net/Google/Calendar.pm Tue Jun 20 01:32:37 2006
+++ lib/Net/Google/Calendar.pm Tue Jun 20 00:59:16 2006
@@ -293,7 +293,7 @@
my $atom = $r->content;
my $feed = XML::Atom::Feed->new(\$atom);
- return map { bless $_, 'Net::Google::Calendar::Entry' } $feed->entries;
+ return map { bless $_, 'Net::Google::Calendar::Entry'; $_->_initialize(); $_ } $feed->entries;
}