Bug 8708

Summary: RSS feed for new comments is broken
Product: Koha Reporter: Owen Leonard <oleonard>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P5 - low CC: chris, jonathan.druart, magnus, nengard, paul.poulain
Version: 3.8   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 8708 - RSS feed for new comments is broken
[SIGNED-OFF] Bug 8708 - RSS feed for new comments is broken
Bug 8708 [Revised] RSS feed for new comments is broken
[SIGNED-OFF] Bug 8708 [Revised] RSS feed for new comments is broken

Description Owen Leonard 2012-08-31 13:02:02 UTC
Adding the KohaDates plugin to the recent comments template also added some whitespace at the beginning of the file. This breaks XML processing.
Comment 1 Owen Leonard 2012-08-31 13:12:13 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2012-08-31 13:41:04 UTC
Hi Owen,
I have not tested this patch. But if it just removes boundary characters, I think a comment is welcomed.
Indeed if a stubborn of alignment and indentation (like me !) read that in the future, he would certainly re-add them :)
Comment 3 Owen Leonard 2012-08-31 13:53:22 UTC
Sorry Jonathan, but I'm confused. Are you asking for more information?
Comment 4 Magnus Enger 2012-08-31 13:55:37 UTC
Maybe a TT-comment that says "Make sure there are no spaces/newlines here, it will ruin the XML processing"? And use [%- and -%] to remove whitespace introduced by the comment?
Comment 5 Jonathan Druart 2012-08-31 14:01:55 UTC
(In reply to comment #4)
> Maybe a TT-comment that says "Make sure there are no spaces/newlines here,
> it will ruin the XML processing"? And use [%- and -%] to remove whitespace
> introduced by the comment?

It is exactly what I meant, thanks Magnus :)
Comment 6 Nicole C. Engard 2012-08-31 14:13:19 UTC Comment hidden (obsolete)
Comment 7 Owen Leonard 2012-09-05 16:51:21 UTC Comment hidden (obsolete)
Comment 8 Nicole C. Engard 2012-09-05 19:54:58 UTC
Created attachment 11991 [details] [review]
[SIGNED-OFF] Bug 8708 [Revised] RSS feed for new comments is broken

Removing white space from the beginning of the file
so that XML processing will work correctly.

Before the patch, viewing the page
(/cgi-bin/koha/opac-showreviews.pl?format=rss) in a browser
which supports RSS handling (ex: Firefox)  will show you
unformatted and broken-looking text. After the patch the
page will trigger the browser's built-in RSS-handling format.

Revision: Template now includes comment pointing out that the <xml>
declaration must not have any white space before it.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Comment 9 Jonathan Druart 2012-09-06 07:45:27 UTC
Thank you Owen.
Marked as Passed QA.
Comment 10 Paul Poulain 2012-09-12 13:32:32 UTC
Patch pushed to master
(Not sure this patch applies or is relevant for 3.8)
Comment 11 Chris Cormack 2012-09-12 20:35:40 UTC
Pushed to 3.8.x will be in 3.8.5