I have a content type with a computed field.
When I save the node and the module cck notifications is enabled, I get the following error:
* warning: array_fill() [function.array-fill]: Number of elements must be positive in C:\wamp\www\drupal\includes\database.inc on line 253.
* warning: implode() [function.implode]: Invalid arguments passed in C:\wamp\www\drupal\includes\database.inc on line 253.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) OR (f.field = 'nid' AND f.intval = 2036) OR (f.field = 'type' AND f.value = '' at line 1 query: INSERT INTO notifications_queue (uid, destination, sid, module, eid, send_interval, send_method, cron, created, conditions) SELECT DISTINCT s.uid, s.destination, s.sid, s.module, 37, s.send_interval, s.send_method, s.cron, 1253626651, s.conditions FROM notifications s INNER JOIN notifications_fields f ON s.sid = f.sid WHERE (s.status = 1) AND (s.event_type = 'node') AND (s.send_interval >= 0) AND ((f.field = 'field_status' AND f.value IN ('a:1:{s:5:\"value\";s:7:\"pending\";}')) OR (f.field = 'field_notes_order' AND f.value IN ('a:1:{s:5:\"value\";N;}')) OR (f.field = 'field_product_test' AND f.value IN ('a:1:{s:3:\"nid\";s:3:\"245\";}')) OR (f.field = 'field_price_test' AND f.value IN ('a:1:{s:5:\"value\";s:7:\"1004.89\";}')) OR (f.field = 'field_product_title' AND f.value IN ('a:1:{s:3:\"nid\";s:1:\"1\";}')) OR (f.field = 'field_amount3' AND f.value IN ('a:1:{s:5:\"value\";s:1:\"1\";}')) OR (f.field = 'field_price_order' AND f.value IN ()) OR (f.field = 'nid' AND f.intval = 2036) OR (f.field = 'type' AND f.value = 'order') OR (f.field = 'author' AND f.intval = 1)) GROUP BY s.uid, s.destination, s.sid, s.module, s.send_interval, s.send_method, s.cron, s.conditions HAVING s.conditions = count(f.sid) in C:\wamp\www\drupal\sites\all\modules\notifications\notifications.module on line 466.My computed code:
if (!$node->nid) node_save($node);
$node_field[0]['value'] = db_result(db_query("SELECT field_price_value FROM content_type_product WHERE nid=%d",$node->field_product_test[0][nid]));
What does this computed field do:
It takes the value of the field price of a referenced node.
I got this code from the code snippets in the documentation of the computed field module.
If I disable the cck notifications module, the error does not appear.