I'm not sure if this is a mail_edit issue or date or cck or subscriptions issue but I was advised to post this here. With respect to the date issue below, I've posted the question to the date module issue queue. However, with respect to the text issue below, it appears this is the place to post this issue. The two could be directly related to cck, or are separate. Don't know yet.
I go to administer->site building->mail templates and configure the digest template to include a cck date using the date module and text field created using the cck module.
When the date is printed in the digest email, it contains HTML tags, and when text is printed, it contains HTML coding, even though the user's account is configured to receive e-mail in plain text only AND MimeMail is disabled:
Title: MPAA: Box Office Up 5.2%, Foreign Ticket Sales Dominate
<span class="date-display-single">04/01/2009</span>
Now, instead of just asking, "How much are you offering?" people browsing the
booths at the Locations Trade Show 2009 -- which kicks off today at the Santa
Monica Civic Auditorium and runs through Saturday -- must also ask, "Is
the money really there and am I going to get it in the end?"
I know that the text is being entered in plain text format because I have disabled wysiwyg editor from this node field. I uninstalled mimemail, but the date is still wrapped in these tags and quotation marks are still converted to html format. Any ideas on how to remove this HTML coding from the date and text printed in the digest?
I posted this in the subscriptions issue forum and got this reply:
#1
salvis - April 3, 2009 - 00:18You mean a cck date field?
subscriptions_cck.module uses the following code
if (!($formatted = html_entity_decode( content_format($field_info, $value, 'plain'), ENT_QUOTES, 'UTF-8'))) { $formatted = content_format($field_info, $value, 'default'); }to try to retrieve the field data in 'plain' format. If nothing is returned, it then asks for the 'default' format. Please take this information to the queue of the cck module that supplies your date field and ask there, why you're getting the span tags.
Any suggestions?
Comments
Comment #1
yched commentedThe 'plain' formatter for a text field does a check_plain(), which encodes entities. Not sure why the wrapping html_entity_decode() does not detect them, but that should be fixed in the calling code.
As for dates : I don't think date fields have a 'plain' formatter, so the code above displays the result of the 'default' formatter, which contains HTML tags.
I don't see any bug for CCK to fix there.
Comment #2
somebodysysop commentedThank you for clarifying this. I'll bounce the text issue back to subscriptions module. It appears that the date.module is supplying the above as the "plain" format, so that issue should go to them.
I guess I can say this is fixed as far as cck goes. Thanks!
Comment #3
salvis@yched: Could it be that text field doesn't have a 'plain' formatter either?
I'm a bit unsure about the parameters to html_entity_decode() — are these correct?
How can we get rid of the HTML tags? Run the return value from the default formatter through filter_xss() with an empty $allowed_tags? And then through html_entity_decode()?
I need plain text for inserting into email messages. Is it correct to try to use the 'plain' formatter first, or should I use the 'default' formatter only? I had a hard time finding this type of information...
Comment #5
guidot commentedMaybe salvis did not get the attention from yched because the issue was still marked fixed. Therefore changing to active.
Comment #6
avpadernoI am closing this issue, as it has been created for a release that is now not supported.