Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#9 | ctools-n1760578-9-d7.patch | 1.93 KB | DamienMcKenna |
#5 | ctools-n1760578-5-d7.patch | 1.93 KB | DamienMcKenna |
#4 | ctools-n1760578-4-d7.patch | 1.93 KB | DamienMcKenna |
Comments
Comment #1
DamienMcKennaRelated:
Comment #2
DamienMcKennaRelated Metatag issue: #1363476: Panels integration - ensure meta tags work OOTB on entity pages
Comment #3
DamienMcKennaAfter 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.
Comment #4
DamienMcKennaSimilar to the node_view change, this runs user_view() on the $account, saving the output for later in case it is necessary.
Comment #5
DamienMcKennaA small tweak to the last patch that removes the $function variable as it is no longer needed.
Comment #6
DamienMcKennaThis needs some additional work, it should also trigger the page title handling.
Comment #7
DamienMcKennaNever mind, I think I found the solution for the page titles in #1732538: Page title pattern ignored. Pushing this back for review.
Comment #8
kimwes CreditAttribution: kimwes commentedI 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).
Comment #9
DamienMcKennaGood catch, thanks. This patch fixes the typo.
Comment #10
caschbre CreditAttribution: caschbre commentedI 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.
Comment #11
DamienMcKenna@japerry: Any thoughts on this one?
Comment #13
rjacobs CreditAttribution: rjacobs at Center for Research Libraries commentedIt 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).