I'm having the following problem, I'd like to use the "title" token in my feed story but I get the following error:
"Application response error
Supplied template data does not cover the following tokens [title] needed for template '{*actor*} just added {*title*}.' You can see this because you are one of the developers of the app."
So, I've setup a module with the following hook:
function fb_feed_story_fb_feed_show_dialog_alter(&$params){
$params['tokens'] = array('[title]' => 'test');
//kpr($params);die;
}
But that doesn't quite seem to do the trick... I'm assuming I don't know the proper way to set the $params['tokens'] field. Has anyone successfully done this before? If so, can you point me in the right direction of how to set this field to replace the value of the token "{*title*}" with "test"?
Comments
Comment #1
nighthawk117 commentedAlso tried array('title' => 'test');
Comment #2
nighthawk117 commentedOk, I've done a deeper dive on this and it appears that if I use the following hook:
AND I modify fb_feed.module line 601 to read
then everything works! So, it seems this is a bug in fb_feed.module...
Comment #3
Dave Cohen commented$params['tokens'] helps you to use Drupal tokens when showing feed dialogs. And the drupal token api uses a strange data structure not at all like what you're creating.
Instead, use the alter hook to add your values to $params['options']['template_data']. This will be passed to the showfeeddialog function the way you expect. And you can alter other parameters to the function, see http://wiki.developers.facebook.com/index.php/Facebook.showFeedDialog.
And undo the change you've made to line 601. That will break the handling of the other parameters.
Comment #4
nighthawk117 commentedThanks Dave, that works. I guess this is obvious to people more familiar with Drupal!
Comment #5
Dave Cohen commentedNot obvious to anyone, really. I tried to make the parameters reflect the documentation of the facebook methods. But there's little rhyme or reason to what they do over there at facebook.