I am using the Service links module in my Drupal 7 site.

When using the Facebook "like" widget, I get the word "error" (in red color), in the place where the Facebook "Like" button should be.

When clicking on the word "Error", a Facebook popup window is opened with the error like so:

The href URL must be absolute

Note: I am using the Service links widgets inside a view. Other Services links widgets are working great, such as the Facebook share widget, Twitter, Google+ and Pinterest widgets.

What is the problem of the Facebook "like" button?

  • sounds to me like the service links module isn't putting in an absolute href: last year facebook made this mandatory when it updated its api. so, I'd go and put this in the issue queue of that module...
    – Jimajamma
    Feb 27, 2014 at 23:05
  • Go to this link: drupal.org/node/2039431 Try patch #8 by TheCrow. It worked well for me. :) Apr 3, 2014 at 3:33

2 Answers 2


Replace this line(in sites\all\modules\service_links\js\facebook_like.js):

iframe.src = $(this).attr('href').replace('http://', '//').replace(/http[s]*\%3A\/\//, '');

with the below line:

iframe.src = $(this).attr('href').replace('http://', '//');

I also had the problem that the button was not showing up. I tried the patch mentioned by Astha chauhan and pachabhaiya, but it still didn't work. I found the problem after comparing the code given by Facebook Developers with the code generated by the widget: The appId was not included in the iframe src. My fix was to replace the line (in sites\all\modules\service_links\js\facebook_like.js):

iframe.src = $(this).attr('href').replace('http://', '//').replace(/http[s]*\%3A\/\//, '');


iframe.src = $(this).attr('href').replace('http://', '//') + "&appId=" + Drupal.settings.ws_fs.app_id;`

see also: Facebook Like Widget Broken - App ID not included [#2417729] | Drupal.org

Not the answer you're looking for? Browse other questions tagged or ask your own question.