[trunk][saas-2][7.0]Sanitizing html content when saving new template corrupts placeholders in some html attributes

Bug #1273251 reported by Olivier Laurent (Acsone)
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Low
OpenERP Publisher's Warranty Team

Bug Description

To reproduce:
- go to one of the runbot/saas-2 instances
- From Messaging/Organizer/Contacts, select a partner from the partner list
- More/Partner Mass Mailing
- fill-in a subject
- click on the "Show Source" button of the body composer
- insert an html tag like this: <a href="${object.id}">Hello</a>
- save as new template
- click on the "Show Source" button again
- the body has been sanitized like this: <a href="%24%7Bobject.id%7D">Hello</a>
- at this point, accepting to send the mail from the composer does not produce expected effect, i.e., replacement of placeholders by real values inside the html href attributes.

In this use case, it seems the method "html_sanitize" is called too early.

Notes:
- By clicking on the (new) template link in the composer, we can see that the "transformation" affects also the final content of the new template not only the body of the mail in the composer
- can also be reproduced on [7.0]
- tested on revision 5004 of [saas-2/server]
- can only be reproduced fromwithin the mail composer, not from the classic form view of email templates

Thanks to fix this issue on both [saas-2] and [7.0] branches.

Tags: maintenance

Related branches

summary: - Sanitizing html content when saving new template corrupts placeholders
- in some html attributes
+ [trunk][saas-2][7.0]Sanitizing html content when saving new template
+ corrupts placeholders in some html attributes
Revision history for this message
Olivier Laurent (Acsone) (olivier-laurent) wrote :

Linked to opw-603452

description: updated
Changed in openobject-addons:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
tags: added: maintenance
Revision history for this message
Olivier Laurent (Acsone) (olivier-laurent) wrote :

Independently you save as new template or not, simply sending mails from the "Patner Mass Mailing" feature corrupts some html attributes in message bodies. To reproduce:

- go to runbot/[saas-2]
- Settings -> Technical -> Email -> Templates
- create a new template on res.partner model with the following content: <a href="${object.id}">Hello</a>
- Messaging/Organizer/Contacts, select 2 partners
- More -> Partner Mass Mailing
- Select your newly created template, a link appears in the html body field
- Fill-in a Subject, check both options "Post..." and "Replies..." and "Send"
- Settings -> Technical -> Email -> Messages
- Edit one of the 2 messages
- Switch to the HTML view of the html widget of the message body field

=> value of the href attribute is "%24%7Bobject.id%7D" not the expected partner id.

Revision history for this message
Olivier Laurent (Acsone) (olivier-laurent) wrote :

Also linked to opw-603909

Changed in openobject-addons:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Martin Trigaux (OpenERP) (mat-openerp) wrote :

Hello,

We had fixed this in trunk. We have now backported the change in 7.0.

Regards

revno: 5228 [merge]
revision-id: <email address hidden>

Changed in openobject-addons:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.