Bug #13070

Copyright pop-up HTML content not rendering

Added by Dan Gillean almost 3 years ago. Updated almost 3 years ago.

Status:VerifiedStart date:05/29/2019
Priority:MediumDue date:
Assignee:Douglas Cerna% Done:


Target version:Release 2.5.2
Google Code Legacy ID: Tested version:2.5
Sponsored:No Requires documentation:


In issue #8771 we added a customizable pop-up that administrators can configure so a user must agree to specific terms of access before being able to view a master digital object. This copyright pop-up should allow users to add HTML and inline CSS to style the content. In issue #8886 we further added the ability for users to preview their custom HTML in a new page. This functionality is described in the 2.5 user manual here:

Also in the 2.5 release, we introduced Markdown support for formatting, in issue #12148.

Currently it appears that the addition of markdown is interfering with the rendering of the HTML on the copyright pop-up page. We'll need to add the same or a similar escaping strategy as what we added to homeSuccess and indexSuccess to ensure that HTML content still works on these pages when the Markdown functionality is turned on.

<?php echo render_value_html($sf_data->getRaw('content')) ?>

To reproduce

  • Configure the copyright pop-up as per the documentation - remember to enable public access to the master DO!
  • In Admin > Settings > Permissions, enable the Copyright pop up
  • Add some HTML content to the editable area - a sample block included in the public demo site is included below - and save
  • Press the preview button on the copyright pop-up

Error encountered

HTML content added to the copyright pop-up is escaped, and does not display styled.

Expected outcome

HTML and inline CSS added to the copyright pop-up will display properly when the Markdown setting is enabled.

Copyright pop-up sample HTML

<div class="alert-danger" style="padding: 1px;">
<h1 style=" text-align: center;">Copyright Notice</h1>
<p>By copyright permission of the owner, this repository makes these digital object copies available to you for research, private study, or other purpose permitted under fair dealing as set out in the "Copyright Act":http://laws-lois.justice.gc.ca/eng/acts/C-42/Index.html.

<p>Use of the copies for any other purpose <strong>requires the authorization of the copyright owner(s).</strong> It is your responsibility to contact the copyright owner(s) to obtain permission.</p>

<img class="img-circle" style="width: 80px; display: block;  margin-left: auto;  margin-right: auto;" align="middle"  src="https://c1.staticflickr.com/4/3225/3020135683_41c68d66f7.jpg" />


#1 Updated by Dan Gillean almost 3 years ago

  • Assignee set to Douglas Cerna
  • Target version set to Release 2.5.1

#3 Updated by Steve Breker almost 3 years ago

  • Status changed from New to Feedback

CR complete. Change looks great!

#4 Updated by Douglas Cerna almost 3 years ago

  • Status changed from Feedback to QA/Review

Merged. Ready for QA.

#5 Updated by Dan Gillean almost 3 years ago

  • Status changed from QA/Review to Verified
  • Assignee changed from Douglas Cerna to Dan Gillean

#6 Updated by Dan Gillean almost 3 years ago

  • Status changed from Verified to Feedback
  • Assignee changed from Dan Gillean to Douglas Cerna
  • Target version changed from Release 2.5.1 to Release 2.5.2

This has been reported not working in 2.5.1, and I've just confirmed locally. Looking at the PR, I think maybe this never got cherry-picked back to stable/2.5.x? Douglas can you check please?

#7 Updated by Douglas Cerna almost 3 years ago

Dan, I just cherry-picked the commit to the stable/2.5.x branch

#8 Updated by Dan Gillean almost 3 years ago

  • Status changed from Feedback to Verified

Also available in: Atom PDF