Bug 24473 - Syndetics content should be $raw filtered on opac-detail.tt
Summary: Syndetics content should be $raw filtered on opac-detail.tt
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Lucas Gass
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-21 17:38 UTC by Lucas Gass
Modified: 2020-09-18 20:01 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Syndetics provides enhanced content which is displayed in the OPAC under the tabs 'Title Notes', 'Excerpt', 'About the author', and 'Editions'. They provide this information as HTML but Koha currently displays the content with the HTML tags. This fixes this so that the enhanced content displays correctly.
Version(s) released in:
20.11.00, 20.05.03, 19.11.09


Attachments
Bug 24473: Add $raw filter for Syndetics content (3.32 KB, patch)
2020-01-21 18:00 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 24473: Add $raw filter for Syndetics content (3.37 KB, patch)
2020-01-29 13:32 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 24473: Add $raw filter for Syndetics content (3.45 KB, patch)
2020-07-12 11:12 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass 2020-01-21 17:38:39 UTC
Syndetics offers enhanced content in the OPAC under the tabs 'Title Notes', 'Excerpt', 'About the author', 'Editions'. They provide this info as HTML therefore we should filter it as $raw so the content shows up without the markup.
Comment 1 Lucas Gass 2020-01-21 18:00:11 UTC
Created attachment 97679 [details] [review]
Bug 24473: Add $raw filter for Syndetics content

TEST PLAN:
1. have a Syndetics account set up and turn on the Syndetics system preferences.
2. Find title(s) with Syndetics content for 'Title Notes', 'About The Author', 'Excerpt' and 'Reviews'.
3. Notice that any HTML markup displays literally.
4. Apply patch and restart_all.
5. Notice that HTML should display correctly.
Comment 2 ByWater Sandboxes 2020-01-29 13:32:16 UTC
Created attachment 98077 [details] [review]
Bug 24473: Add $raw filter for Syndetics content

Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se>
Comment 3 David Nind 2020-02-03 08:31:59 UTC
Looks like this was signed-off, but the status wasn't changed. Have changed to signed-off.
Comment 4 Jonathan Druart 2020-02-05 13:45:13 UTC
Can we imagine whitelist a list of html tags?
Comment 5 Katrin Fischer 2020-02-09 10:37:40 UTC
(In reply to Jonathan Druart from comment #4)
> Can we imagine whitelist a list of html tags?

Can you explain this a bit? I am not sure what the Syndetics code looks like, but as it's a paid for service... I hope the risk of malicious code would be small here.
Comment 6 Lucas Gass 2020-02-10 14:45:44 UTC
Cait,

Syndetics sends HTML. So a description might look like this:

<p>Dementors and House-elves, merpeople and Chinese Fireball Dragons--these are just a few of the magical creatures and frightening monsters populating J. K. Rowling's wizarding world. Harry Potter: The Creature Vault is a fascinating look at how this menagerie was brought to life for the blockbuster Harry Potter film series. Detailed profiles of each creature include rare concept illustrations, behind-the-scenes photography, and filmmaking secrets from the Warner Bros. archive. A removable poster picturing each of the creatures and an interactive Eeylops Owl Emporium catalog complete this must-have package.</p>


Librarians would like this to $raw filter on the OPAC.
Comment 7 Katrin Fischer 2020-02-11 07:10:25 UTC
(In reply to Lucas Gass from comment #6)
> Cait,
> 
> Syndetics sends HTML. So a description might look like this:
> 
> <p>Dementors and House-elves, merpeople and Chinese Fireball Dragons--these
> are just a few of the magical creatures and frightening monsters populating
> J. K. Rowling's wizarding world. Harry Potter: The Creature Vault is a
> fascinating look at how this menagerie was brought to life for the
> blockbuster Harry Potter film series. Detailed profiles of each creature
> include rare concept illustrations, behind-the-scenes photography, and
> filmmaking secrets from the Warner Bros. archive. A removable poster
> picturing each of the creatures and an interactive Eeylops Owl Emporium
> catalog complete this must-have package.</p>
> 
> 
> Librarians would like this to $raw filter on the OPAC.

Hi Lucas, I understand, I was wondering about Jonathan's suggestion. Whitelisting might actually work if it's only <p> etc. but wondering if they send styling information etc. too. Leaning the way that $raw might be safer?
Comment 8 Jonathan Druart 2020-02-13 13:27:48 UTC
Lucas, Is that possible to list exhaustively the different HTML tags used by this ws?
Comment 9 Katrin Fischer 2020-03-15 20:52:52 UTC
Wonder if there is any technical documentation on the Syndectics API we could check - maybe there is a way to receive data without HTML? Or there are hints on what can be included.

Not sure we should block this tho - You pay for Syndetics services, so it seems reasonable to assume the data will be ok.
Comment 10 Jeremy Evans 2020-05-11 13:58:17 UTC
We are trying out Syndetics. One of the books contains an excerpt.
The OPAC is displaying the Syndetics tags around this.

e.g.  <opt> <anon I1="BLANK" I2="BLANK">1 Missing Data  TEXT EXCERPT HERE....   </anon> </opt>
Comment 11 jduffels 2020-06-16 17:26:06 UTC
We are having issues similar to Jeremy and Katrin. What I find odd is that often for the same record, the Syndetics info will look fine for one section, say the tile notes, but display the Syndetics tags in another, such as the excerpt.
Comment 12 Katrin Fischer 2020-07-12 10:11:14 UTC
I see that Stina had signed this off originally, setting back to "signed off".
Comment 13 Katrin Fischer 2020-07-12 11:12:02 UTC
Created attachment 106805 [details] [review]
Bug 24473: Add $raw filter for Syndetics content

Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 14 Jonathan Druart 2020-07-20 12:07:57 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 15 Lucas Gass 2020-07-24 23:04:36 UTC
backported to 20.05.x for 20.05.03
Comment 16 Aleisha Amohia 2020-08-03 22:37:46 UTC
backported to 19.11.x for 19.11.09
Comment 17 Victor Grousset/tuxayo 2020-09-18 20:01:17 UTC
Not backported to oldoldstable (19.05.x). Feel free to ask if it's needed.