I had two problems using this action

1) I first tried using [title] and it did not convert to the proper title.

2) After adding an additional token provided by cck i get this fatal error
Fatal error: Unsupported operand types in /var/www/construction/sites/all/modules/rules/rules/rules.admin_rule_proxy.inc on line 26

Thanks

Comments

agn507’s picture

Component: Rules Core » Rules Engine

I seen the same problem was posted here
http://drupal.org/node/314310

I did some more digging to figure out where it was failing and narrowed it down to rules.module around line #1017.

I added some print_r statements to figure out what was happening

    $configurations[$item_type] = array();
    while ($row = db_fetch_object($result)) {
    	print_r($row);
      $configurations[$item_type][$row->name] = unserialize($row->data);
      print_r($configurations);
    }

the output of print_r($row) is something like this

stdClass Object ( [name] => rules_1 [data] => a:8:{s:5:"#type";s:4:"rule";s:4:"#set";s:17:"event_node_insert";s:6:"#label";s:21:"Send email on contact";s:7:"#active";i:1;s:7:"#weight";s:1:"0";s:7:"#status";s:6:"custom";s:11:"#conditions";a:1:{i:0;a:5:{s:5:"#type";s:9:"condition";s:9:"#settings";a:2:{s:4:"type";a:1:{s:7:"contact";s:7:"contact";}s:13:"#argument map";a:1:{s:4:"node";s:4:"node";}}s:5:"#name";s:31:"rules_condition_content_is_type";s:5:"#info";a:3:{s:5:"label";s:26:"created content is Contact";s:9:"arguments";a:1:{s:4:"node";a:2:{s:4:"type";s:4:"node";s:5:"label";s:7:"Content";}}s:6:"module";s:4:"Node";}s:7:"#weight";d:0;}}s:8:"#actions";a:1:{i:0;a:5:{s:7:"#weight";d:0;s:5:"#info";a:6:{s:6:"module";s:6:"System";s:9:"arguments";a:1:{s:6:"object";a:2:{s:4:"type";s:5:"value";s:13:"default value";N;}}s:5:"label";s:39:"Display a tokenized message to the user";s:4:"base";s:25:"rules_core_action_execute";s:11:"action_name";s:28:"token_actions_message_action";s:12:"configurable";b:1;}s:5:"#name";s:39:"rules_core_token_actions_message_action";s:9:"#settings";a:2:{s:7:"message";s:14:"[title]\015\012[nid]";s:13:"#argument map";a:1:{s:6:"object";s:6:"object";}}s:5:"#type";s:6:"action";}}} )

Ugly I know but the point is $row->name has a value and $row->data has serialized information.

The line to unserialize the data fails and printing out $configurations ends up with this
Array ( [rules] => Array ( [rules_1] => ) )

Followed by an error

Fatal error: Unsupported operand types in /var/www/construction/sites/all/modules/rules/rules/rules.admin_rule_proxy.inc on line 27

The actions I have verified this fails on are display tokenized message and send tokenized email.

One thing I did notice is that when i first saved this rule with the action applied I only had one token [title] in the subject. This saved correctly and reported no errors. It only started failing after adding tokens supplied by cck. It seems as if the serialized data is corrupt which causes the unserialize function to fail on $row->data.

Hopefully this is enough information..

fago’s picture

Status: Active » Closed (won't fix)

hm, I don't know what's the issue here, but as you can see here (http://drupal.org/node/316631) , support for these actions has been completely dropped now. Update to the next dev snapshot and they are gone.

also see http://groups.drupal.org/node/10270/faq - rules provides better equivalent actions instead.

If the problem occurs with any other action, please reopen.

agn507’s picture

What equivalent actions are provided? I need to make use of the tokens in the email that gets sent out and on the "Send email" actions there are no tokens provided. Could it be the token help fieldset is just not showing up and including a token will work just fine?