This issue is a response to http://www.ubercart.org/forum/bug_reports/9343/default_filter_full_html_... . Attached is a patch for the couple of missing format filter elements.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 386018.filter_form_handling.2.x.patch | 4.37 KB | cha0s |
| #8 | 386018.filter_form_handling.2.x.patch | 4.24 KB | cha0s |
| #4 | 386018.ca_email_filter.2.x.patch | 557 bytes | cha0s |
| #3 | 386018.ca_email_filter.2.x.patch | 1.13 KB | cha0s |
| ca.email_filter.patch | 929 bytes | cha0s |
Comments
Comment #1
hedac commentedthanks
I have to test it later. but I see that it has format => 1
Does it mean full html format has the id 1?
my Full html format is id 3 not 1, I don't know why.
ie, this is the page I have to go to edit full html filter: admin/settings/filters/3
Comment #2
Island Usurper commentedThe invoice email action sets the filter to 2, which is what the Full HTML format usually is. I had thought that this format couldn't be changed, but that's just the Filtered HTML option, which doesn't usually allow for the tags in the default invoice.
This patch needs to take out that line in the action callback function.
Comment #3
cha0s commentedHey, I did as you said, but I'm wondering... why? Why do we use the filter in the email function if it isn't changeable by the user?
Comment #4
cha0s commentedOops, I messed that patch up due to fuzz. Here's another one.
Comment #5
hedac commentedI've tried both patchs.. and with 'format' => 1 or 'format' => 3 and still not having full html emails.
But also I have all the table and img tags in the default filter as allowed tags... but I only get emails with p and br tags.
if I set drupal to full html as default filter.. then emails are ok with all the tables and img of the logo in bills.
Comment #6
rszrama commentedTagging.
Comment #7
Island Usurper commentedBecause of the way the filter_form() function works, we can't use it unless we know where exactly it lies in the form. Because of the way the conditions and actions forms are built, uc_order_action_email_invoice_form() can't know where in the form it is. You have to pass the form #parents to filter_form() to let its value be submitted properly, especially if there can be more than one on a page. The easiest thing to do (I thought) was to just assume the Full HTML format, since that what we usually want anyway.
<img>and<table>tags aren't allowed by the Filtered HTML format by default, but it's the only one guaranteed to be there.I think the best thing is to pass along the #parents array to the conditions' form functions. Part of me wants to pass the entire form as it's being built, but I'm not sure what benefit is gained from that at this point.
Comment #8
cha0s commentedSoo... worked on this a sec. Opinions welcome, but I guess this'll solve our problem. FAPI should put some little marker element in filters like I did here, that'd make this kind of thing easier to solve.
Still it's not like super complex, and I commented liberally =). Added the filter settings and form children where applicable.
Comment #9
Island Usurper commentedLooks like it works. Couple of questions before I commit it, though.
Why is
'format' => 1,being added to the #arguments in uc_order_ca_action()? I don't think it belongs there.Also, since the format forms work, the hard-coded format should be taken out of uc_order_action_email_invoice(), right?
Comment #10
cha0s commentedYeah, you're right. New patch takes care of those.
Comment #11
Island Usurper commentedI decided that the format = 1 should have been put on the predicates from the cart module. Committed the patch with that change, and the one in uc_order_action_email_invoice().