When the like button is clicked while viewing a HTTPS site, the Facebook preview image and title are redirected to our external single sign on page. This behavior prevents the like button from properly representing the content that was 'liked'. By replacing https with http in the fbml tag, the preview appears correctly in Facebook.

Attached is a patch that detects https links being sent to Facebook and rewrites them as http links. Also, there is an option added to the configuration menu that allows for enabling or disabling the feature.

CommentFileSizeAuthor
fb_social.patch1.67 KBmdulzo
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ferdi’s picture

Is there any general rule when rewriting will be required. If this just happens for your site, then it's probably a better idea for you to override the theme function in your template.

ferdi’s picture

Sorry about the delay here. Is this something that is happening only in your site? Or with all https links ?

DamienMcKenna’s picture

Version: 6.x-1.0-beta4 » 7.x-2.x-dev
Issue summary: View changes

First off the code needs to be updated to Drupal's coding standards. Secondly, because the module has moved on so much there'd need to be a D7 version of the patch first and then recreate it for older versions. Thirdly, I'm not entirely sure this is the best way of handling it, it feels very much like a hack to work around a limited use case with little general benefit; what might be better would be to add an option that controls whether links are output as HTTP, HTTPS or automatically decided upon based upon the current URL.