Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
fb_social.patch | 1.67 KB | mdulzo |
Comments
Comment #1
ferdi CreditAttribution: ferdi commentedIs 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.
Comment #2
ferdi CreditAttribution: ferdi commentedSorry about the delay here. Is this something that is happening only in your site? Or with all https links ?
Comment #3
DamienMcKennaFirst 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.