I was attempting to use the module with the Rules module. But, am having limited success getting it to work. I have used this module in this fashion with earlier revisions. Has any one tried this on the 6.x-3.x version?

I created a triggered rule on event "After updating existing content". On this rule I'm setting the do action to "Post a message to Twitter". The message is posting to Twitter, but I'm having trouble getting any replacement expression or variables to work. I've also tried embedding PHP code (I think this is what I did on earlier version and have seen other issues referring to this method), but this also doesn't seem to work. The PHP shoes as a string and doesn't evaluate. I would prefer to use PHP code or the replacement expressions listed in the rules creation because I would like to output CCK content.

I did some limited debugging and found that the object passed to twitter_actions_set_status_action is set to NULL and the context only has Twitter module info. I tried doing a backtrace to debug further, but was getting too much recursion errors. I'm a little lost, so I thought I'd throw this out there in case someone else might know what is going on.

Here is the scrubbed output of the object and context with the method is called. In this example my message was attempting to use a replacement expression and a variable. The output on the twitter feed is the same as what's shown in the message, no variable substitution done.

object: NULL
context: array ( 'twitter_uid' => '<twitter id>', 'screen_name' => '<twitter account>', 'message' => 'test [nid] %body', 'password' => NULL, )

Comments

ahansen1’s picture

Status: Active » Closed (fixed)
lokolo’s picture

i have the same problem, how did you fix it?

lokolo’s picture

Status: Closed (fixed) » Active
ahansen1’s picture

I'm using embeded PHP, e.g.

<?php print substr($node->field_myfield[0]['value'], 0, 100) ?>
<?php if(strlen($node->field_myfield[0]['value']) > 100) print '...' ?>
<?php print twitter_shorten_url(url('node/'. $node->nid, array('absolute' => TRUE))) ?>

The PHP was not originally working because I hadn't enabled the PHP Filter module.

lokolo’s picture

Thanks!
Will try this solution :)

steinmb’s picture

Status: Active » Closed (works as designed)