Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: jamesw [...] bsdhosting.co.za
Cc:
AdminCc:

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



Subject: Adding WebContent to Calendar Entries fails with 404
Date: Fri, 21 Dec 2007 19:18:22 -0800
To: Bugs in Net-Google-Calendar via RT <bug-Net-Google-Calendar [...] rt.cpan.org>
From: James Wright <jamesw [...] bsdhosting.co.za>
When adding a Webcontent link to a Net::Google::Calendar::Entry, the gCal namespace is not added, this results in Google returning a less than helpful 404 error message. This patch adds namespace to the WebContent function and prepends 'gCal:' to the child nodes that get added for GadgetPrefs.
--- lib/Net/Google/Calendar/WebContent.pm.orig Wed Dec 19 13:31:25 2007 +++ lib/Net/Google/Calendar/WebContent.pm Fri Dec 21 19:12:40 2007 @@ -119,7 +119,8 @@ sub webContent { my $self = shift; - my $name = 'gcal:webContent'; + my $gcal_ns = $ns; + my $name = 'webContent'; if (@_) { my %params = @_; # h-h-hack @@ -128,24 +129,24 @@ $self->_set_type($type); } my $prefs = delete $params{prefs}; - XML::Atom::Base::set($self, '', $name, '', \%params); - my $content = $self->_my_get('', $name); + XML::Atom::Base::set($self, $gcal_ns, $name, '', \%params); + my $content = $self->_my_get($gcal_ns, $name); foreach my $key (keys %{$prefs}) { # TODO: this feels icky my $node; if (LIBXML) { - $node = XML::LibXML::Element->new($name.'GadgetPref'); + $node = XML::LibXML::Element->new('gCal:'.$name.'GadgetPref'); $node->setAttribute( Name => $key ); $node->setAttribute( Value => $prefs->{$key} ); } else { - $node = XML::XPath::Node::Element->new($name.'GadgetPref'); + $node = XML::XPath::Node::Element->new('gCal:'.$name.'GadgetPref'); $node->addAttribute(XML::XPath::Node::Attribute->new(Name => $key)); $node->addAttribute(XML::XPath::Node::Attribute->new(Value => $prefs->{key})); } $content->appendChild($node); } } - return $self->_my_get('', $name); + return $self->_my_get($gcal_ns, $name); } 1;
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #31822] Adding WebContent to Calendar Entries fails with 404
Date: Sat, 22 Dec 2007 15:18:57 +0000
To: James Wright via RT <bug-Net-Google-Calendar [...] rt.cpan.org>
From: Simon Wistow <simon [...] thegestalt.org>
On Fri, Dec 21, 2007 at 10:20:45PM -0500, James Wright via RT said: Show quoted text
> When adding a Webcontent link to a Net::Google::Calendar::Entry, the > gCal namespace is not added, this results in Google returning a less > than helpful 404 error message.
Hah! I just patched this in SVN yesterday although I think your way looks slightly cleaner so I may switch it around. Inspired by your bug reports and patches I spent yesterday doing a fair bit of clean up (and also talking to the author of XML::Atom, who sits next to me, about some ways to clean up the interface). The module's now gained a proper test suite, including pod and pod-coverage and I'm working on turning bin/google-calendar back into a proper useful tool rather than the hodepodge of tests and examples that it's become. SVN repo is here if you're interested https://svn.unixbeard.net/simon/Net-Google-Calendar/ I tend to work much better when there I have feature requests so keep them coming! Thanks for all the patches, Simon