Because in the admin interface of orders we can create orders without customer account, on all default rules in ubercart we need to set default rules to check if uc_order:email is not empty.

If we don't check this an error is logged:
Attempted to send an order e-mail with no recipient.

This is easy to fix if we set a condition to check for empty email in each *.rules_default.inc

I can do the patch if you think this should be commited to core...

CommentFileSizeAuthor
#3 1433364-ignore-empty-email.patch1.13 KBlongwave

Comments

longwave’s picture

Title: Default rules check uc_order:email is not empty » "Attempted to send an order e-mail with no recipient" may be intentional

Instead of adding a condition we could just remove this code from uc_order.rules.inc:

  if (empty($recipients)) {
    watchdog('uc_order', 'Attempted to send an order e-mail with no recipient.', array(), WATCHDOG_ERROR);
    return;
  }

I am in two minds as to whether this test should be removed, or whether this error could actually be useful. Perhaps as a compromise it should be downgraded from WATCHDOG_ERROR, and linked back to the order in question so an administrator can see why this occurred?

SilviuChingaru’s picture

I think no error or warning should be logged because this should be the normal behavior of an order with "No account required". Right?

longwave’s picture

Status: Active » Needs review
StatusFileSize
new1.13 KB
SilviuChingaru’s picture

Status: Needs review » Reviewed & tested by the community

Normal behavior now. Thank you!

longwave’s picture

Status: Reviewed & tested by the community » Fixed

Committed #3.

Status: Fixed » Closed (fixed)

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