Friday, February 03, 2012

Facebook widget "Invalid action type"

UPDATE 11:25a CT: Facebook has fixed the "Invalid action type" error, so you don't have to change your code now, though I don't think the addition will hurt anything, either.

EARLIER: I came into work today with a note from my boss that our Facebook Recommendations widget was displaying "Invalid action type" on our home page. Not good.

I didn't know of another site off-hand that used the same widget, which was the iFrame version of the Recommendations Box Social Plugin, so I did a quick search for "invalid action type" and found that I wasn't alone, along with a possible solution.

GeeksTrack's suggestion is in a comment by Besnik Selimi, though it wasn't quite explicit enough for my tastes. It was enough to get through the solution.

First task was to switch from the iFrame solution to the Javascript SDK version, which I had tested but not implemented.

The affected code for the widget in question was:

<fb:recommendations site="www.statesman.com" width="300" height="245" header="true" colorscheme="light" ref="homepage"></fb:recommendations>


I added the 'data-action="like"' parameter, as suggested by Selimi:

<fb:recommendations site="www.statesman.com" data-action="like" width="300" height="245" header="true" colorscheme="light" ref="homepage"></fb:recommendations>


I'm not sure of a solution for the iFrame code. I tried adding &data-action=like to the url string and that didn't work. Interestingly, even Facebook's widget wizard is busted.

3 comments:

Younews.in 10:27 AM  

Use an action type attribute to your comments plugin. For example action=like and it will fix the problem. Since the introduction of Timeline Facebook as made it mandatory to add action types.

For implementation reference see source at any story page of http://younews.in

Teej 11:08 AM  

It's been fixed without altering anything. If you went to Facebooks Officially Recommend Box creator it was also broken.

The fix happened just before 9:40 AM MST. You can revert to your old code.

Teej 11:09 AM  

*Facebook's Official Recommendations Box:
http://developers.facebook.com/docs/reference/plugins/recommendations/

  © Blogger template 'A Click Apart' by Ourblogtemplates.com 2008

Back to TOP