When using the Open Graph meta tag submodule of the Meta Tags module combined with Facebook Comments Box, you get two og:url and og:title meta tags. I haven't tested but suspect the same would happen using the Open Graph Meta Tag module.

This causes an error on the Facebook comments.

Example of the error from Facebook:

Object at URL 'http://www.example.com/article/xyz' of type 'article' is invalid because it specifies multiple 'og:url' values

Is there a way you could add the option to exclude the og meta tags for when you have another module that handles them.

Comments

lexfunk’s picture

Thanks for posting. We will weigh our options, having the option to exclude tags is a good idea.

terlikk’s picture

Same problem here. Still wating for the solution...

ioanmar’s picture

The same happens with Open Graph Meta Tag module.

Multiple og:url values are generated.

Any plans on fixing this?

ioanmar’s picture

Priority: Normal » Major
JBodkin’s picture

Agreed, this needs to be optional

quercus020’s picture

Also agreed. I have the same issue with Open Graph Meta Tag module. I'm need to be able to specify the preview image (og:image) which I can do with Open Graph Meta Tag module but the Facebook Comments Box always selects the logo.png.

studio ml’s picture

A simple hack is to put this line in coment:

// drupal_add_html_head($metafcb, 'meta-fcb');

in the file:

facebook_comments_box.module

cwithout’s picture

A temporary solution that doesn't involve hacking the module is to use hook_html_head_alter(). Obviously, this is still not ideal, and the best solution is for the module to make these tags optional.

// Removes all meta tags added by facebook comments module
function [module]_html_head_alter(&$head_elements) {
  if (isset($head_elements['meta-fcb'])) {
    unset($head_elements['meta-fcb']);
  }
}
// Retains the fb:admins meta tag
function [module]_html_head_alter(&$head_elements) {
  if (isset($head_elements['meta-fcb'])) {
     $head_elements['meta-fcb']['#markup'] = preg_replace('/\<meta property="og:[^"]*" content="[^"]*"\s*\/\>/i', '', $head_elements['meta-fcb']['#markup']);
  }
}
leonano’s picture

//$markup .= '<meta property="og:image" content="' . theme_get_setting('logo') . '"/>';

leon kessler’s picture

Okay seems pretty adamant from this issue that if metatags opengraph is enabled, all handling of meta tags should be left to this module.

Uploading patch...

leon kessler’s picture

leon kessler’s picture

Status: Active » Needs review
markkus69’s picture

Hi

I'm having the same issue on 7.x-1.1 version.

And please someone help me. How to apply this patch?

I'm new on drupal and i'm a lot of days triyng ow to figure out this problem.

leon kessler’s picture

From the command line, run this from the module folder (with the patch file copied inside)
$ patch -p1 < facebook_comments_box-fix-conflicts-with-metatag-module-1507628-8232469.patch

More info on applying patchs here: https://drupal.org/patch/apply

I've just run into this issue again on another site! :-(
Can we get this patch into the module?

markkus69 if you get this working and tested, can you mark the ticket as "reviewed and tested by the community", thanks.

marty.true’s picture

This issue is also happening on the Facebook Comments module, so likely similar code causing the issue.