When selecting 'Send invoice receipt email' for an action the next page does not load and I cannot save my action.

CommentFileSizeAuthor
#1 commerce_invoice_receipt-1496750-1.patch571 bytesLes Lim
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Les Lim’s picture

There appears to be a collision with the defined name of the Rules action in the hook_rules_action_info() implementation. Defined actions look for a configuration form with a function name of ACTIONNAME_form(), so the action "commerce_invoice_receipt_mail" is erroneously trying to use the form function commerce_invoice_receipt_mail_form(), which does something else entirely.

More careful namespacing of actions should fix this. Patch attached.

Les Lim’s picture

Status: Active » Needs review

Changing status.

nasheet’s picture

This patch works for me. Thank you.

BrianLP’s picture

This doesn't work for me. If I apply the patch, I get "Unknown action commerce_invoice_receipt_mail".

If I try to enter the action "send invoice receipt mail", the page doesn't load but displays this message:

Notice: Undefined property: RulesReactionRule::$order_id in commerce_invoice_receipt_mail_form() (Line 13 ... /commerce_invoice_receipt.admin.inc).
Notice: Undefined property: RulesReactionRule::$mail in commerce_invoice_receipt_mail_form() (Line 19 ... /commerce_invoice_receipt.admin.inc).

Les Lim’s picture

@papalapapp: try flushing your caches, then delete the action from the rule entirely and re-add the action back in.

Les Lim’s picture

accidental triple post.

Les Lim’s picture

accidental triple post.

BrianLP’s picture

Tripple post? o.O Too much coffee?

Re-adding the action did it. Thanks!

Jorrit’s picture

My recommendation is to change the form id of the form "commerce_invoice_receipt_mail_form" instead of changing the id of the rule, because in that way, the rulesets still work. I think less people care that the form id has changed as opposed to the number of people that are influenced when the rule id is changed.

[edit]
I changed the name of the form to commerce_invoice_receipt_mail_admin_form and that works fine.

brephraim’s picture

Patch didn't work, but #9 worked for me.

brephraim’s picture

To clarify, I manually applied the change recommended in #9, after applying the patch. So possibly both were necessary, don't know...

Daglees’s picture

Applied patch and fixed form name.

Daglees’s picture

Status: Needs review » Closed (fixed)
Daglees’s picture

Status: Closed (fixed) » Fixed

Fix status

Status: Fixed » Closed (fixed)

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