Subject: | iso8601 date parsing error with recent bugzilla |
in version 1.04, BZ-Client implemented conversion of on-the-wire dates
from XML into data objects using DateTime::Format::ISO8601. However,
just around the same time, the bugzilla team changed the on-the-wire
format of the dates to a non-conforming date format (due to some broken
spec somewhere else). To work around this, BZ-Client needs to handle
this newer broken date format, as well as the older standards compliant
format.
Patch is attached.
See also the bugzilla bug referencing the change in bugizilla:
https://bugzilla.mozilla.org/show_bug.cgi?id=550618
Subject: | BZ-Client-noncompliant-iso8601date.patch |
--- BZ/Client/XMLRPC/Value.pm~ 2011-08-22 09:52:47.000000000 -0400
+++ BZ/Client/XMLRPC/Value.pm 2012-07-18 15:37:43.715726217 -0400
@@ -71,7 +71,11 @@
$self->{'level1_content'} = undef;
$self->{'level1_elem'} = undef;
if ("dateTime.iso8601" eq $name) {
- $self->{'result'} = DateTime::Format::ISO8601->parse_datetime( $self->{'result'} );
+ my $val = $self->{'result'};
+ if ($val =~ /(\d\d\d\d)(\d\d)(\d\d)(T\d\d:\d\d:\d\d)/) {
+ $val = "$1-$2-$3$4";
+ }
+ $self->{'result'} = DateTime::Format::ISO8601->parse_datetime( $val );
}
}
}