Bug 27691

Summary: Allow HTML in notes for saved SQL reports
Product: Koha Reporter: Lucas Gass (lukeg) <lucas>
Component: ReportsAssignee: Lucas Gass (lukeg) <lucas>
Status: In Discussion --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: barbara.johnson, jonathan.druart, rcoert
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 27691: Add $raw filter to report notes output
Bug 27691: Add $raw filter to report notes output
Bug 27691: Add $raw filter to report notes output

Description Lucas Gass (lukeg) 2021-02-11 23:25:41 UTC
Some reports have a long and detailed notes section pertaining to a given report. With the html filter it can be very difficult to parse out those notes. 

Is there any reason we cannot use a $raw filter in this situation?
Comment 1 Lucas Gass (lukeg) 2021-02-11 23:30:08 UTC
Created attachment 116783 [details] [review]
Bug 27691: Add $raw filter to report notes output

To test:
Add a report with some notes that include HTML: <p>TEST</p>
Run the report, the HTML displays literally
Apply patch
Run the report again. HTML looks good
Comment 2 ByWater Sandboxes 2021-02-12 15:20:03 UTC
Created attachment 116836 [details] [review]
Bug 27691: Add $raw filter to report notes output

To test:
Add a report with some notes that include HTML: <p>TEST</p>
Run the report, the HTML displays literally
Apply patch
Run the report again. HTML looks good

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Comment 3 Barbara Johnson 2021-02-12 15:20:44 UTC
The html looked great.  This is a big improvement.
Comment 4 Katrin Fischer 2021-02-14 13:59:47 UTC
Created attachment 116853 [details] [review]
Bug 27691: Add $raw filter to report notes output

To test:
Add a report with some notes that include HTML: <p>TEST</p>
Run the report, the HTML displays literally
Apply patch
Run the report again. HTML looks good

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Jonathan Druart 2021-02-15 10:57:13 UTC
The problem is that this saved_sql.notes field can be filled in by Mana, so I don't think we can trust the data coming from there.

We should first make sure the data is sanitized before it is inserted into the Mana DB.
Comment 6 Katrin Fischer 2021-02-15 21:40:56 UTC
Is there a way we could remove HTML elements before uploading to Mana as a compromise? I believe the tagging feature does "scrubbing" of the input in a way, maybe that could be useful?
Comment 7 Jonathan Druart 2021-02-16 07:39:52 UTC
Yes, it's what I meant with "sanitized", HTML tags must be removed.