The og:url meta tag for the node which is the frontpage has the node URL rather than the site URL. This means that FB has issues with circular references and also if the site URL is used on FB then it doesn't find the correct information.
Quickly looking at the code I implemented the following solution which changed
private function get_og_tag_defaults($node = NULL, $full_view = FALSE) {
//....
$ret[self::URL] = url(drupal_get_path_alias('node/'.$node->nid),array('absolute' => TRUE));
//....
to be
private function get_og_tag_defaults($node = NULL, $full_view = FALSE) {
//....
if (drupal_is_front_page()) {
$ret[self::URL] = url('<front>', array('absolute' => TRUE));
}
else {
$ret[self::URL] = url(drupal_get_path_alias('node/'.$node->nid), array('absolute' => TRUE));
}
Is this a sensible solution?
It works with my testing and and FB's debugger (https://developers.facebook.com/tools/debug) now likes it.
Comments
Comment #1
rwohlebHere is a solution you can do in a custom module until this is fixed:
Comment #2
capellicTrying to implement this my custom module named "alter". You can see that my code has a dsm() call in it. This is never executed. I've cleared my cache. I looked for the hook_og_tag_render_alter() function in your module, but I can't find it. Tips?
Comment #3
capellicI found this other case and it became apparent that the solution provided in #1 is NOT in 7.x-1.2. It showed up in 7.x-1.x-dev dated December 16, 2011.
1. Download the DEV version.
2. Enable the new module, "Open Graph meta tags test module" (The first time I reloaded a page on a site I got some funny error about func_get_args() not allowed to be a parameter on line 9 of opengraph_meta_test_module.module, but I commented out the function, reloaded the page (it was fine) and then removed the commenting-out and reloaded the page and it was fine. Huh.)
3. Add a function like shown in #1 above.
4. It works!
Comment #4
torotil commentedThis is fixed in 7.x-2.x which uses metatag for rendering the metatags.