Subject: | Net::Google::Calendar creates duplicate tags when editing an existing record. |
Date: | Tue, 18 Dec 2007 03:04:29 -0800 |
To: | bug-Net-Google-Calendar [...] rt.cpan.org |
From: | James Wright <jamesw [...] bsdhosting.co.za> |
When editing an existing Calendar Entry, setting visibility,
transparency, when or recurrence results in an error due to duplicate
entries for those fields. Entry.pm passes both the gd namespace and the
'gd:' prefix when setting the value of those tags. By removing the
latter, editing functions correctly and those fields can be modified and
the entry can be saved.
Attached: a patch to remove 'gd:' prefixes from calls in _gd_element.
when, who, and recurrence.
Now, with the patch actually attached
--- lib/Net/Google/Calendar/Entry.pm.orig Sun Dec 16 04:52:27 2007
+++ lib/Net/Google/Calendar/Entry.pm Tue Dec 18 01:49:53 2007
@@ -141,7 +141,7 @@
if (@_) {
my $val = lc(shift);
- $self->set($self->{_gd_ns}, "gd:${elem}", '', { value => "http://schemas.google.com/g/2005#event.${val}" });
+ $self->set($self->{_gd_ns}, $elem, '', { value => "http://schemas.google.com/g/2005#event.${val}" });
return $val;
}
my $val = $self->_attribute_get($self->{_gd_ns}, $elem, 'value');
@@ -206,7 +206,7 @@
my $format = $allday ? "%F" : "%FT%TZ";
- $self->set($self->{_gd_ns}, "gd:when", '', {
+ $self->set($self->{_gd_ns}, "when", '', {
startTime => $start->strftime($format),
endTime => $end->strftime($format),
});
@@ -256,7 +256,7 @@
my $stuff = { rel => "http://schemas.google.com/g/2005#event.attendee" };
$stuff->{email} = $person->email if $person->email;
$stuff->{valueString} = $person->name if $person->name;
- $self->add($ns_uri,"gd:${name}", '', $stuff);
+ $self->add($ns_uri,"${name}", '', $stuff);
}
}
my @who = map {
@@ -370,7 +370,7 @@
my $recur = $event->as_string;
$recur =~ s!(^BEGIN:VEVENT\n|END:VEVENT\n$)!!sg;
- $self->set($self->{_gd_ns}, 'gd:recurrence', $recur);
+ $self->set($self->{_gd_ns}, 'recurrence', $recur);
return $event;
}