Just installed OpenGraph to control thumbnails of sharable items. That works.
Getting LOTS of "already output" messages in watchdog.
opengraph_meta Feb 6 2012 - 2:28pm Already output og:site_name Guest
opengraph_meta Feb 6 2012 - 2:28pm Already output og:url Guest
opengraph_meta Feb 6 2012 - 2:28pm Already output og:description Guest
opengraph_meta Feb 6 2012 - 2:28pm Already output og:title Guest
Oddly only the og:site_name and og:title meta tags are repeated in the head.
How can I tackle this?
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | 1431846-opengraph_meta-node_restrict-14.patch | 615 bytes | trrroy |
| #8 | opengraph_meta-node_restrict.patch | 779 bytes | guybedford |
Comments
Comment #1
mazdakaps commentedhaving the same issue
Comment #1.0
doublejosh commentedspacing
Comment #2
quercus020 commentedI'm having the same issue too. I have open graph set up to work on just one content type, and all works fine on the individual node pages. My frontpage is a view showing 15 teasers of the content type. Unfortunately opengraph tries to output meta tags for all the teasers on the frontpage...one works (the first teaser) the rest just creates 14 sets of warnings in the admin report. Seems to me open graph should only work on full node and not a view but I can't find a work around.
I'm on D7 and opengraph 1.2
Comment #3
doublejosh commentedThat's good background, but the functions that load up the tags seem to be careful about only full page mode.
I see repeated tags (described in #1) on the full page.
D7
D6
Comment #4
WillGFP commentedSame problem here, happens on a page with a View that displays many different nodes. Looks like it's trying to write duplicate metatags for each node on the page. Perhaps there's a way to disable the module on certain pages? Or only output one tag for pages with multiple nodes?
Version 7.x - 1.2.
Comment #5
doublejosh commentedThink there are two conversations going on here.
#1) My original issue is that I'm seeing duplicate meta tags on full node pages and error messages in the logs.
#2) People are seeing multiple meta tags on pages with multiple nodes.
Comment #6
Island Usurper commentedThis might not be everyone's problem, but I noticed on my site that webform blocks display nodes in 'full' build mode ($page = 1 for D6). This makes opengraph_meta try to display tags for that node as well, even if the page's actual node has been processed.
Maybe in hook_node_view() it should check that it's the same node returned by menu_get_object(). If it's not a node page, then the meta tags are going to supplied by some other code, most of the time. Right?
Comment #7
guybedford commentedFor me, the "already output" message wasn't stopping the module from working, but was an annoyance in polluting the logs.
As a temporary fix, I disabled the log messages by commenting out line 256 of opengraph_meta.common.inc.
Comment #8
guybedford commentedActually, this does functionally mess up quite badly. I've attached a patch which restricts the module to only work for node pages. Again, this is a quick fix that worked in my particular case, I'm sure there is a much more elegant solution.
Comment #9
doublejosh commentedRevisiting, not sure why but the watchdog messages are no longer appearing.
However the duplicates are still in the head for openGraph enabled node pages. Looks like they are being adding at two different times...
NOTE: I'm not experiencing the view page issue, however I don't have any full node (or teaser) views.
Comment #10
shaneonabike commentedMaybe I shouldn't have created a different issue (#2028913: Cron stops working due to Already output og:xxx messages) but in D6 this is also an issue. An actually while these messages might seem harmless they are causing cron to timeout. This means that content is not being indexed by the search ... oops. :(
I tried to apply a similiar patch to the fix above but it didn't do anything different...
Comment #10.0
shaneonabike commentedstrong
Comment #11
jtsnow commentedThis seems to be a pretty major defect.
I've patched my copy of the module to call node_is_page() to check if open graph tags should be rendered in opengraph_meta_node_view().
Comment #12
stevieb commentedI'm also seeing this issue ... patch in #8 works
Comment #13
hargobindThe code that generates the warning looks like this:
opengraph_meta/opengraph_meta.common.inc, line 254: render_data()And that is being called by:
First, there are multiple use-cases where
$view_mode == 'full'such as nodes being displayed by Panels or Views. So the idea of tags being generated more than once it's actually pretty common, and it's not a problem.I think the real "issue" here is the warning message itself. Is "warning" the correct type of status to use here? I think it creates a false sense of emergency. A better solution would be to allow the administrator to choose if they even want to see the message at all. And given my first point above, I think "Do not display the warning" should be the default behavior.
For any sites that I managed, I'm just going to comment out the warning line entirely.
Comment #14
trrroy commentedI can't argue with @hargobind that #8 may not be the best solution but I've been using it for a while on my site and it's working fine for my use case.
Attached is a re-roll of #8 which applies cleanly against version 7.x-1.3.
Comment #16
torotil commentedThis is now fixed in 7.x-1.x. Thanks everyone for contributing!
Comment #18
ykarthikvarma commentedIssue still exists in latest version as well.
Thanks @trrroy the patch does work.