I'm using Scheduler to postpone the scheduling of posts containing Service Links widgets. However, it appears, at least with Facebook, that data for these pages is being cached before the node is published and before Facebook has access to it. This results in no data (image, summary, etc) being available to the widget.

I believe this is the flow:

1. Post is created and saved as unpublished.
2. Because the post contains a Facebook widget, Facebook is notified about the post and crawls the page.
3. Since Facebook doesn't have access to an unpublished node, it caches only the page URL, no data.
4. Once the post is published, clicking the widget brings up Facebook's page cache with no information to actually share.

I have confirmed that is issue does not exist if the post is immediately published rather than scheduled. Also, entering the page URL into Facebook's debugger (https://developers.facebook.com/tools/debug/) immediately updates their cache causing the widget to work again.

So, I guess the question is can we prevent the widgets from notifying their providers until the posts are published?

CommentFileSizeAuthor
#2 service_links_unpublished.patch688 bytesPoieo
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nightlife2008’s picture

Hi Poieo,

I'm having kinda the same issue on a news website of a client and it took us a few days to figure out a possible cause/solution.

Editors frequently create article nodes, without immediately publishing the nodes. This causes the editor to be redirected to the frontend unpublished article upon saving, which in turn causes the Facebook sharing widget to show up.

The sharing widget potentially crawls the page at that time, causing a cached "Access denied" version in Facebook cache.

To prohibit this behaviour we were able to hide the sharing buttons when a node is not published, because we are using a custom module to implement our sharing functionality.

I suggest to do the same if possible. From what I know, service links show up in a block or the node-links section. Both can be altered using the correct hooks (hook_block_view_alter() and hook_node_view_alter()) to hide the links if the node in question is not yet published ($node->status == 1)

Hopefully you can write the patch yourself or contact the module maintainer to fix this.

Poieo’s picture

Category: Support request » Bug report
Status: Active » Needs review
FileSize
688 bytes

Thanks for the insight @nightlife2008.

This simple patch seems to have solved my use case. I can't imagine why anyone would need service links to appear on an unpublished node, so this seems like good fix to me.