Comments

hedac’s picture

thanks
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

Island Usurper’s picture

Status: Needs review » Needs work

The 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.

cha0s’s picture

Status: Needs work » Postponed (maintainer needs more info)
StatusFileSize
new1.13 KB

Hey, 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?

cha0s’s picture

StatusFileSize
new557 bytes

Oops, I messed that patch up due to fuzz. Here's another one.

hedac’s picture

I'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.

rszrama’s picture

Issue tags: +CA

Tagging.

Island Usurper’s picture

Status: Postponed (maintainer needs more info) » Active

Because 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.

cha0s’s picture

Status: Active » Needs review
StatusFileSize
new4.24 KB

Soo... 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.

Island Usurper’s picture

Looks 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?

cha0s’s picture

StatusFileSize
new4.37 KB

Yeah, you're right. New patch takes care of those.

Island Usurper’s picture

Status: Needs review » Fixed

I 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().

Status: Fixed » Closed (fixed)
Issue tags: -CA

Automatically closed -- issue fixed for 2 weeks with no activity.