warning: Invalid argument supplied for foreach() in /home/user/example.com/sites/all/modules/og_node_approval/og_node_approval.module on line 537.
warning: Division by zero in /home/user/example.com/sites/all/modules/og_node_approval/og_node_approval.module on line 544.

I'm getting the above errors when I try to save node into the group. Please fix it.

Comments

mradcliffe’s picture

Assigned: Unassigned » mradcliffe
Status: Active » Needs review

Hmm, that shouldn't be happening at that point in the code. However I have explicitly defined the array so this should be fixed.

Can you please try out the development version when it is updated later today [edit]?

mradcliffe’s picture

Version: 6.x-2.0-beta1 » 6.x-2.x-dev
Status: Needs review » Needs work

needs work?

   if (count($apprs) == 0)
      return;

This does not seem to be working for ozwebguru??

mradcliffe’s picture

Status: Needs work » Closed (fixed)
rkdesantos’s picture

Status: Closed (fixed) » Active

This error has recently popped up on one of my web sites:

warning: Invalid argument supplied for foreach() in /home/example/public_html/sites/all/modules/og_node_approval/og_node_approval.module on line 53

Haven't identified what triggered it and no luck in making it go away either.

I'm running the latest dev version I could find here.

mradcliffe’s picture

Status: Active » Closed (fixed)

That error does not correspond to this issue. I've opened up a new issue.

rkdesantos’s picture

Version: 6.x-2.x-dev » 6.x-2.0-beta2
Status: Closed (fixed) » Active

I'm seeing the same error:
warning: Invalid argument supplied for foreach() in /home/site/public_html/sites/all/modules/og_node_approval/og_node_approval.module on line 538.

line 538 corresponds to :

foreach ($apprs as $appr)
         {
             if ($appr->status == 1)
                 $values['approved']++;
             $values['reviewed']++;
         }

So, the division by zero is fixed but not the invalid argument error.

mradcliffe’s picture

Status: Active » Closed (fixed)

Okay, I am tracking this in issue, #1059740: Invalid foreach, line 538.