By using the HTML editor, I'm not able to apply border on the table in the body of the notification template.
To reproduce :
- Click on Notifications from the menu Admin Tools
- Create a new Trigger of type 'when log is updated' related to the class UserRequest
- Create a new action related to the Trigger that you have just created.
- Fill the properties of this action and insert a table with a border in the Body.
- Create the action.
- The table is inserted without the selected border.
This behavior is expected as you can see here: https://wiki.openitop.org/doku.php?id=2_3_0:admin:rich_text_limitations&s[]=tags#styles_white-list
The table tag ONLY supports attributes "style", "width", not "border"
Unfortunately, the HTML editor embedded into iTop (aka CKEditor) produces a markup that is further excluded by the HTML sanitizer.
The bug can be produced with either the notification templates or notes (document).
A dirty workaround is to disable HTML sanitization, which opens the door to XSS injection. To do so, edit the configuration and add the entry:
'html_sanitizer' => 'HTMLNullSanitizer',Fix implemented in trunk as [r4376] and retrofitted into branch/2.3 as [r4377].
The white list has been enlarged... requires an update of the documentation!
Related
Commit: <Commit _id='5358055aa02bb175d1406271:4376' tree_id='166d4a76f82db52844363bead86416a5c0f83f60' committed=I{'date': datetime.datetime(2016, 9, 5, 13, 1, 8, 262000), 'email': '', 'name': 'romainq'} authored=I{'date': datetime.datetime(2016, 9, 5, 13, 1, 8, 262000), 'email': '', 'name': 'romainq'} message='#1321 Losing table borders (notification templates and notes)' parent_ids=I['5358055aa02bb175d1406271:4375'] child_ids=I['5358055aa02bb175d1406271:4377'] repo_ids=I[ObjectId('5358055aa02bb175d1406271')]>
Commit: <Commit _id='5358055aa02bb175d1406271:4377' tree_id='43af6e5a3ba0aa654acd287753877f1457861f07' committed=I{'date': datetime.datetime(2016, 9, 5, 13, 6, 51, 605000), 'email': '', 'name': 'romainq'} authored=I{'date': datetime.datetime(2016, 9, 5, 13, 6, 51, 605000), 'email': '', 'name': 'romainq'} message='#1321 Losing table borders (and other options configurable in the rich text editor)' parent_ids=I['5358055aa02bb175d1406271:4376'] child_ids=I['5358055aa02bb175d1406271:4378'] repo_ids=I[ObjectId('5358055aa02bb175d1406271')]>