Closed (fixed)
Project:
Rules
Version:
7.x-2.x-dev
Component:
Rules Engine
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Jan 2011 at 16:13 UTC
Updated:
9 Feb 2011 at 17:10 UTC
I experimented a little bit with loops and wsclient data types. This particular programmatic rule failed:
$rule = rule(array('text' => array('type' => 'text')));
$rule->action('wsclient_google_translate', array(
'param_q:select' => 'text',
'param_langpair' => 'de|en',
'result:var' => 'translation',
))
->action('wsclient_twitter_search_search', array('param_q:select' => 'translation:responseData:translatedText', 'result:var' => 'twitter'));
$loop = rules_loop(array('list:select' => 'twitter:results'));
$loop->action('drupal_message', array('message:select' => 'list-item:text'));
$rule->action($loop);
$rule->execute('Programmierung');
Solution: Loop defines "list-item" as default item name, but variable names must not use dashes. Underscore is better and the rule from above works. Patch attached.
| Comment | File | Size | Author |
|---|---|---|---|
| rules-loop-item-name.patch | 522 bytes | klausi |
Comments
Comment #1
fagogood catch. Thanks, committed.