Tuesday, February 15, 2011

Facebook Like Button Redirects User to Wall After Liking - Bug?

Amplify’d from www.hyperarts.com

Facebook Like Button Redirects User to Wall After Liking - Bug?

I've seen numerous reports of this happening since last Thursday, Feb 10, when Facebook announced the new layout and features for fan pages.

When visitors to a Fan Page click the Like Button, they are then redirected to the page's Wall, rather than remaining on the tab.

Impact on Reveal / Fan-gated / Fans-only Content Tabs

Obviously, folks who utilize the popular FBML tag for Reveal Tabs (fb:visible-to-connection) are very unhappy about this. Prior to last Thursday's upgrade (or, um, mostly-up grade), Reveal tabs were working fine.

Why no bug report?

I searched Facebook's Bugzilla site, where bugs in Facebook's platform can be documented and searched, and I couldn't find an existing bug report. Either I just didn't look hard enough OR everyone assumes this change to be part of Facebook's new way of handling the Like button.

It appears Facebook's Intent is to keep the visitor on the tab

In reviewing the coding used for the Like button (using the Firefox browser and the indispensable Firebug tool), it appears to me that the redirect to the Wall is a bug, and that Facebook hasn't intentionally changed how the Like button functions.

When I checked the linking code for the Like buttons that DON'T REDIRECT to the Wall, I saw this:

<a href="#" ajaxify="/ajax/pages/fan_status.php?fbpage_id=115434098510&add=1&reload=1&preserve_tab=1&use_primer=1">

(The "fbpage_id" value is just an example.)

When I checked the linking code for the Like buttons that DO REDIRECT to the Wall, I saw this:
<input id="u451436_1" type="button" onclick="return fbpage_set_fan_status(this, "286426934837", 1, 1, null, null, {"preserve_tab":true})" value="Like">

(Again, the numeric values are just examples.)

As you'll notice, the code that I believe is buggy has {"preserve_tab":true}, similar to the preserve_tab=1 in the code that doesn't redirect.

The broken code should look like this (properly nested quotes, single quotes nested in double quotes):

<input id="u451436_1" type="button" onclick="return fbpage_set_fan_status(this, '286426934837', 1, 1, null, null, {'preserve_tab':true})" value="Like">

Thus, it does look like Facebook has some broken code there and that, once fixed, should get the Like buttons working properly again, keeping users on the same tab they were on when they clicked "Like".

Workarounds for this bug

Although my advice would be not to panic, but just sit tight until this is addressed, others have suggested workarounds, such as adding an FBML/XFBML Like button to your tab's page, although this is a poor second as clicking this Like button doesn't refresh the tab to show the Fan content; the Page has to be manually reloaded.

If you have any additional insights or information, please feel free to comment.

Read more at www.hyperarts.com
 

No comments:

Post a Comment