I am adding an item to a list and have "Enforce uniqueness" enabled. This gives me an error:

Warning: in_array() expects parameter 2 to be array, null given in rules_condition_data_list_contains() (line 359 of \sites\all\modules\rules\modules\data.eval.inc).

Adding an initial value to the "list" or disabling "Enforce uniqueness" causes this error to stop. I think its erroring because the array is empty.

Line 359 says:

  return in_array($item, $list);

I think it should probably be:

  return empty($list) ? FALSE : in_array($item, $list);

Comments

David Stosik’s picture

Version: 7.x-2.2 » 7.x-2.x-dev
Status: Active » Needs review
StatusFileSize
new401 bytes

This makes sense.
Here is a patch on 2.x-dev.

David
This patch is part of the #1day1patch initiative.

tr’s picture

Issue summary: View changes

Bump. Patch still applies.