The module is using the non alias path for frontpage (). The frontpage should be link as it, e.g. www.mydomain.com

There must be codes to detect the frontpage (such as is_front()) and then use the correct path.

Comments

ninjatalk’s picture

I am far from being capable of writing a patch so I have to hack the core with my limited knowledge. I have add this to line 124 of the .module file.

if($variables['node']->nid == 1) // my frontpage nid is 1
$url = url('', array('absolute' => TRUE));

I also changed the following "if" to "elseif".

corbacho’s picture

Status: Active » Postponed

Sorry for not replying before.
Yep, I see your pain there.

The problem is that not always the frontpage it's a node page. For example, the default frontpage is the "/node" path, that shows a list of published nodes (teasers)

Imagine that you set up the Google plus one module to show the g+1 button in the node teasers.

Using the function drupal_is_front_page in the hook_node_view always is going to return TRUE for all the nodes in the frontpage.

A solution would be comparing the path of the node with the frontpage path (taking consideration aliases issues, i18n issues) everytime a g+1 button is rendered, but it's overkill IMHO.

Another solution might be using this condition: if (drupal_is_front_page() && !$teaser)
But this is not covering all the cases, for example a edge case is when a module uses programmatically node_view() to show a node in the frontpage, etc

Conclusion: I don't know how to help in this case without bloating the module

I will mark as postponed by now.