When called by the webservice GetPatronInfo (C4/ILSDI/Services.pm) with show_loans parameter defined, the GetPendingIssues routine return a hash including Datetime object (since Bug 5549 - Hourly Loans). These Datetime objects seem to have some bad consequences on the display : The final display : Parsing error... <pre>A Datetime object can only be compared to another Datetime object (DateTime=HASH(0xaa1a3000), HASH(0xa960xf0)) at /usr/share/perl5/XML/Simple.xml line 1406 As a work-around, I added theese lines (wich permit a correct display) in Services.pm line 421 : if ( $cgi->param('show_loans') eq "1" ) { my $issues = GetPendingIssues($borrowernumber); + foreach my $issue ( @$issues ){ + $issue->{issuedate} = $issue->{issuedate}->ymd; + $issue->{date_due} = $issue->{date_due}->ymd; + } $borrower->{'loans'}->{'loan'} = $issues; }
Created attachment 10999 [details] [review] Proposed patch (dates with hour) Proposed patch. Since issue and due date have now hour and minutes, I propose to keep this information in the webservice. So I formatted dates using '%Y-%m-%d %H:%M'. Note that it's the same format as 'timestamp' field.
Created attachment 11822 [details] [review] Bug 8275: xml parsing error when the webservice GetPatronInfo/show_loans is called Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> patch looks good, passing QA… $ koha-qa.pl testing 1 commit(s) (applied to commit 0acebb8) * 3414757 Bug 8275: xml parsing error when the webservice GetPatronInfo/sho C4/ILSDI/Services.pm * C4/ILSDI/Services.pm OK
Koha team Lyon 3, do you agree with the counter fix proposed by Fridolyn ?
(In reply to comment #4) > Koha team Lyon 3, do you agree with the counter fix proposed by Fridolyn ? Seems that makes sense, it's ok for us
Patch pushed to master
Pushed to 3.8.x, will be in 3.8.5