HTML elements disappear in Calendar's events editor
Written By
Cristina Rodriguez
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
Issue
- When you edit the description of an event in Calendar portlet and elements like <iframe> are added through the Source view to it, after saving the event those elements disappear from the editor.
- Some simple steps to reproduce:
- Add a new calendar event and edit its description.
- Write the following code in Source view:
<p>hello</p>
<iframe></iframe>
-
- Publish the event and check the <iframe> code is gone.
Environment
- Liferay DXP (7.3, 7.2, 7.1, 7.0).
Resolution
- Although ckeditor's "allowedContent" property is true by default in Calendar's ckeditor and any kind of elements should be permitted, AntiSamy is playing a role in its content processing and prevents them from being added to avoid possible malicious code to be injected.
- To avoid this, you must add
com.liferay.calendar.model.Calendar to AntiSamy's whitelist (Control Panel → System Settings → Security Tools → AntiSamy Sanitizer). This way Calendar's content will not be filtered by Antisamy and allowedContent = true will be actually applied.
Did this article resolve your issue ?