When on the create user page as an admin we are getting an error from the rules module - this looks to be the same issue as here #1311310: No method getElementName for this instance of the class RulesOr.

It looks like the problem is in the function uc_coupon_workflow_suspend_element

foreach ($rule->conditions() as $condition) {
  if ($condition->getElementName() == 'uc_coupon_workflow_suspended' && (!$events || count(array_intersect($rule->events(), $events)))) {
    $found[] = $rule->label;
  }
}

Not all the rule conditions have the method getElementName - a nasty fix would be something like

foreach ($rule->conditions() as $condition) {
          if ($condition instanceof RulesAbstractPlugin){
            if ($condition->getElementName() == 'uc_coupon_workflow_suspended' && (!$events || count(array_intersect($rule->events(), $events)))) {
                $found[] = $rule->label;
            }
          }
        }
CommentFileSizeAuthor
#1 1320036-get-element-name.patch888 byteswodenx

Comments

wodenx’s picture

StatusFileSize
new888 bytes

Slightly modified fix (see attached patch) has been committed. Thanks for tracking down.

wodenx’s picture

Status: Active » Needs review
scottrouse’s picture

Status: Needs review » Reviewed & tested by the community

Not sure if RTBC makes sense here or not since the patch has already been committed to dev, but I've tested the latest dev release and this issue is resolved.

Thanks.

wodenx’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

heddn’s picture

Issue summary: View changes

Updated issue summary.