Currently user_view.inc does not execute the normal Drupal hooks, e.g. hook_user_view and hook_entity_view. In order for several other modules to work correctly, e.g. Metatag, these hooks must be executed.

Files: 
CommentFileSizeAuthor
#9 ctools-n1760578-9-d7.patch1.93 KBDamienMcKenna
PASSED: [[SimpleTest]]: [MySQL] 121 pass(es).
[ View ]
#5 ctools-n1760578-5-d7.patch1.93 KBDamienMcKenna
PASSED: [[SimpleTest]]: [MySQL] 67 pass(es).
[ View ]
#4 ctools-n1760578-4-d7.patch1.93 KBDamienMcKenna
PASSED: [[SimpleTest]]: [MySQL] 67 pass(es).
[ View ]

Comments

DamienMcKenna’s picture

DamienMcKenna’s picture

After forgetting to hit the Save button, I've confirmed that user_view pages load the global meta tags rather than either the user entity values or the individual user object's values.

DamienMcKenna’s picture

Status:Active» Needs review
StatusFileSize
new1.93 KB
PASSED: [[SimpleTest]]: [MySQL] 67 pass(es).
[ View ]

Similar to the node_view change, this runs user_view() on the $account, saving the output for later in case it is necessary.

DamienMcKenna’s picture

StatusFileSize
new1.93 KB
PASSED: [[SimpleTest]]: [MySQL] 67 pass(es).
[ View ]

A small tweak to the last patch that removes the $function variable as it is no longer needed.

DamienMcKenna’s picture

Status:Needs review» Needs work

This needs some additional work, it should also trigger the page title handling.

DamienMcKenna’s picture

Status:Needs work» Needs review

Never mind, I think I found the solution for the page titles in #1732538: Page title pattern ignored. Pushing this back for review.

kimwes’s picture

I think you have a bug in patch at comment #5 on line 94 where you have return $rc($node); .
I think that should be return $rc($account).

DamienMcKenna’s picture

StatusFileSize
new1.93 KB
PASSED: [[SimpleTest]]: [MySQL] 121 pass(es).
[ View ]

Good catch, thanks. This patch fixes the typo.

caschbre’s picture

I have a project with logic in hook_user_view that is needed and not being executed for panel pages. I'm going to give this patch a shot to see if it solves the issue.

DamienMcKenna’s picture

Issue summary:View changes

@japerry: Any thoughts on this one?

rjacobs’s picture

Status:Needs review» Postponed

It seems to me that this should probably be postponed until #2422123: should entity view hooks be triggered unconditionally in node_view, term_view and user_view pages? lands, as part of that solution can be re-used here. Basically #2422123 tracks a static variable to see what entity view hooks have been invoked already, which can be re-used here to ensure user_view() is only fired when needed (as opposed to being fired unconditionally).