Download & Extend

"Invalid argument supplied for foreach()" in "Execute custom PHP code"-Action

Project:Rules
Version:6.x-1.0-rc2
Component:Rules Engine
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Hello,
If my rule is triggered the following message appears:
"warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\hierarchie.php on line 124".

Line 124: foreach($array1 as $p => $value2) {

There is no warning when I manually start this script.
Can anybody help me?

Comments

#1

Category:bug report» support request

It looks like $array1 is no array...

#2

But it's initiated as an array:
$array1 = array();

#3

Status:active» postponed (maintainer needs more info)

Please post an export of your rule.

#4

I used a function with global variables, when I remove them, it works!?

#5

Status:postponed (maintainer needs more info)» fixed

#6

Status:fixed» closed (fixed)

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

nobody click here