Problem/Motivation
On a site with comment_fragment.module working, any meta tags added by metatag.module will fail to render.
This is because comment_fragment.module changes the path to the comment to match the node path, and therefore this is being returned as TRUE from the _metatag_entity_is_page() function even though it isn't the page.
As metatag_entity_view() is only processed once per page and it already has a TRUE response, the node is not processed so no metatags are rendered.
Proposed resolution
If a comment is passed into _metatag_entity_is_page(), return FALSE straight away and ignore the comment entity. This let metatag_entity_view() run on the needed node entity and work successfully.
A patch is attached.
Comment | File | Size | Author |
---|---|---|---|
#4 | metatag-comment-fragment-conflict-2265447-4.patch | 857 bytes | opdavies |
Comments
Comment #1
opdaviesComment #2
opdaviesComment #4
opdaviesRe-rolled patch.
Comment #5
DamienMcKennaI think this makes sense. Testing the current functionality without Comment Fragment being installed, loading e.g. /comment/1 shows the meta tags for the node page the comment belongs to, because /comment/1 actually loads the node page that's associated with that comment.
Comment #6
DamienMcKennaCommitted. Thanks!
Comment #8
tvn CreditAttribution: tvn commentedThanks for being so quick, Damien.
Comment #9
opdaviesHear, hear.