It is impossible for modules that want to rely on using hook_entity_view() or hook_taxonomy_term_view() to consistently work across all entities since forum terms will never execute this hook because forum_page() executes no hooks at all. Also missing would be a hook_taxonomy_term_view_alter() and hook_entity_view_alter().

#5 1122808-forum-metatag-fix-4-d7.patch4.41 KBbago
FAILED: [[SimpleTest]]: [MySQL] Setup environment: failed to create checkout database.
[ View ]


mparker17’s picture


sun’s picture

Issue tags:-entity API, -entity cleanup

Standardizing on "entity" tag, which will be renamed to "Entity system".

DamienMcKenna’s picture

This is a sibling issue to #1067120: Missing hook_taxonomy_term_view() or hook_entity_view() when viewing a term, once that issue is committed I'll work on this one.

andypost’s picture

Also take care with forum's preprocess functions, related #148145: "Forums" title is not localized

bago’s picture

new4.41 KB
FAILED: [[SimpleTest]]: [MySQL] Setup environment: failed to create checkout database.
[ View ]

In order to allow "metatag" module to alter metatag for the forum taxonomy pages I had to
1) backport the D8 patch from #148145: "Forums" title is not localized: initially I tried the D7 patch from comment #55 but didn't work, so I backported the latest D8 patch (that also returns a render array instead of calling theme).
2) add a taxonomy_term_view (so that hooks are called, even if the results are "ignored") before returning the render array:

  // Invoking taxonomy_term_view let metatag to intercept we are on a taxonomy page and inject metatags.
  if ($forum_term->tid) {
    taxonomy_term_view($forum_term, 'full');

I don't know if the scope of this issue should be first limited to D8 and simply try to add that taxonomy_term_view call in the D8 branch that already include #148145: "Forums" title is not localized: I see that "needs d7 backport" has been removed from #148145: "Forums" title is not localized but it is still here in this one.

matt2000’s picture

Status:Active» Needs review
matt2000’s picture

Status:Needs review» Needs work

Whoops. Thats a d7 patch. We still need a d8 patch.

mgifford’s picture

Assigned:Dave Reid» Unassigned
Issue summary:View changes