hook_entity_view_alter() should receive the entity as separate parameter, $type is then deprecated as we've classed objects now.

CommentFileSizeAuthor
#2 1618140-entity-view-alter.patch5.54 KBaspilicious

Comments

fago’s picture

Title: hook_entity_view_alter() should misses the entity object » hook_entity_view_alter() misses an $entity parameter

Related hooks are:

core/modules/comment/comment.api.php:function hook_comment_view_alter(&$build) {
core/modules/entity/entity.api.php:function hook_entity_view_alter(&$build, $type) {
core/modules/node/node.api.php:function hook_node_view_alter(&$build) {
core/modules/taxonomy/taxonomy.api.php:function hook_taxonomy_term_view_alter(&$build) {
core/modules/user/user.api.php:function hook_user_view_alter(&$build) {
aspilicious’s picture

Status: Active » Needs review
StatusFileSize
new5.54 KB

Lets see if this works

aspilicious’s picture

I also *tried* to change hook_entity_view

fago’s picture

Status: Needs review » Reviewed & tested by the community

Thanks! The patch looks good to me, -> RTBC.

@hook_entity_view()
oh, I see. This overlaps with #1618136: Remove $type from entity hooks a bit now, but that one needs to be rerolled anyway.

fgm’s picture

Status: Reviewed & tested by the community » Fixed

Merged into #1618136: Remove $type from entity hooks, following up there.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

fago’s picture

Issue tags: -sprint

Removing sprint tag.