Skip Menu |

This queue is for tickets about the Net-Google-Calendar CPAN distribution.

Report information
The Basics
Id: 30224
Status: resolved
Priority: 0/
Queue: Net-Google-Calendar

People
Owner: simonw [...] cpan.org
Requestors: mrallen1 [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.8
Fixed in: (no value)



Subject: Getting objects, hoping for scalars
It's been a while since the last release of this code, and I saw in some other bug reports that you've been waiting on a new release of XML::Atom (or one of its children) to release a new version of your code. Maybe that's happened and you haven't had time to roll up a new version of this module. Anyway, I installed this module from CPAN and it seems to be returning objects (like XML::Atom::Entry, XML::Atom::Person) instead of string scalars which was kind of what I was expecting to get. So I made a patch to fix up some of those things. I left the author and content methods returning an object, though.
Subject: Net-Google-Calendar-return-scalar.patch
--- Entry.pm 2007-04-16 02:20:11.000000000 -0500 +++ /Library/Perl/5.8.6/Net/Google/Calendar/Entry.pm 2007-10-23 11:34:07.000000000 -0500 @@ -145,8 +145,15 @@ $self->set($self->{_gd_ns}, "gd:${elem}", '', { value => "http://schemas.google.com/g/2005#event.${val}" }); return $val; } - my $val = $self->_my_get($self->{_gd_ns}, $elem, 'value'); - $val =~ s!^http://schemas.google.com/g/2005#event\.!!; + my $val; + my $node = $self->_my_get($self->{_gd_ns}, $elem, 'value'); + if ( defined $node ) { + if ( $node->hasAttribute( 'value' ) ) { + $val = $node->getAttribute( 'value' ); + } + $val =~ s!^http://schemas.google.com/g/2005#event\.!!; + } + return $val; } @@ -165,7 +172,13 @@ return $val; } - return $self->_my_get($self->{_gd_ns}, 'where', 'valueString'); + my $loc = $self->_my_get($self->{_gd_ns}, 'where', 'valueString'); + if ( defined $loc ) { + if ( $loc->hasAttribute('valueString') ) { + return $loc->getAttribute('valueString'); + } + } + return $loc; } # work round get in XML::Atom::Thing which stringifies stuff @@ -229,7 +242,7 @@ push @rets, $start; } } else { - die "No start date ".$self->as_xml; + warn "No start date ".$self->as_xml; } if (defined $end) { if ($start->hasAttribute('endTime')) {
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #30224] Getting objects, hoping for scalars
Date: Wed, 24 Oct 2007 20:51:32 +0100
To: Mark Allen via RT <bug-Net-Google-Calendar [...] rt.cpan.org>
From: Simon Wistow <simon [...] thegestalt.org>
On Tue, Oct 23, 2007 at 12:45:15PM -0400, Mark Allen via RT said: Show quoted text
> So I made a patch to fix up some of those things. I left the author and > content methods returning an object, though.
Cool, I'll look over these and make a new release. Thanks, Simon
I've finally got round to doing something about this - I've just released 0.9 which I think should solve all your problems. Sorry about the long wait - totally inexcusable.