I have added open graph tags to my site, but on one content type OG tags don't work properly. They are present in html but when checked with FB tool http://developers.facebook.com/tools/debug I get 500 error for them. This is one of the links
http://turkeydental.co/alanya-dental-clinic and this is what I get

http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fturk...

and The 'og:url' property is required, but not present.

But it is in html, only thing I see is that order of meta tags is all jumbled up, so maybe this confuses FB?

CommentFileSizeAuthor
#3 metatag-n1978568-3.patch1.92 KBDamienMcKenna
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DamienMcKenna’s picture

I think the problem is that there's a newline character in the og:description that's confusing the OG parser.

DamienMcKenna’s picture

Title: Open graph gets 500 error » Don't output line breaks in meta tags
Version: 7.x-1.0-beta7 » 7.x-1.x-dev
Component: Open Graph » Code
Issue tags: +D7 stable release blocker

Lets focus this issue on the line breaks and fix it for all meta tags.

DamienMcKenna’s picture

Status: Active » Needs review
FileSize
1.92 KB

Please test this patch and let me know if it removes the line break in the og:description meta tag.

Marko B’s picture

I did apply the patch but FB debuger still output the same error.

Pls’s picture

Patch works great, thanks.

DamienMcKenna’s picture

Status: Needs review » Reviewed & tested by the community

@deepM: While there may still be a problem, the line breaks are no longer causing part of the problem. I think the remaining problem boils down to the core RDF module being enabled, which is known to cause problems with validating the Open Graph meta tags.

DamienMcKenna’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

Marko B’s picture

Status: Fixed » Reviewed & tested by the community

Which part of RDF? Html tags seems fine, don't get it what is the problem for validators.

Tried w3c validation
http://validator.w3.org/check?uri=http%3A%2F%2Fturkeydental.co%2Fdental-...

there are some problems with RDF there.

How could I test this thing. I would cut off scripts, meta tags line one by one and then check it agains validator but only way I know is that I disable module one by one. I could also save a page as html and then edit lines (if page works that way), anyone knows some better way?

DamienMcKenna’s picture

Status: Reviewed & tested by the community » Fixed

@deepM: Try disabling the RDF module, see if that fixes the problem, it has fixed the problem for others.

Marko B’s picture

Seems no one even checked what I posted :-) anyway it works now. What I realized that FB caches URL and data, so even If you change something to URL it uses data it first got. So probably this line break fix worked when cache expired.

Automatically closed -- issue fixed for 2 weeks with no activity.