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.

CommentFileSizeAuthor
rules.patch933 bytessreynen

Comments

karens’s picture

Project: Content Construction Kit (CCK) » Rules
Version: 6.x-3.x-dev » 6.x-1.x-dev
Component: Rules Integration » Rules Engine

This is a question for the Rules module.

sreynen’s picture

I 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?

jboese’s picture

does this fix the problem where Rules always believes a filefield has changed during a node edit?....

mitchell’s picture

Title: _content_rules_field_has_value errors when checking filefield changes » Checking filefield changed causes _content_rules_field_has_value errors
Project: Rules » Content Construction Kit (CCK)
Component: Rules Engine » Rules Integration
Status: Active » Needs review

Moving for test bot.