I'm using a rules condition to check if a filefield changes. This check assumes the field deltas are arrays both before and after:
if (count(array_diff_assoc($sub_value, $node_value[$delta])) != 0) {
But on an empty filefield, one of those is set to NULL. array_diff_assoc() only works on arrays, so this gives an error. Attached patch compares type first, and only does the array_diff_assoc() check if both are arrays.
| Comment | File | Size | Author |
|---|---|---|---|
| rules.patch | 933 bytes | sreynen |
Comments
Comment #1
karens commentedThis is a question for the Rules module.
Comment #2
sreynen commentedI don't understand how this belongs in the Rules issue queue when the code is in CCK. Is the CCK rules code moving to the Rules module?
Comment #3
jboese commenteddoes this fix the problem where Rules always believes a filefield has changed during a node edit?....
Comment #4
mitchell commentedMoving for test bot.