Change $entity_type to $type in

$entity->foo = mymodule_add_something($entity, $entity_type);

Comments

jhodgdon’s picture

Title: Documentation problem with hook_entity_load » hook_entity_load doc example uses wrong variable
Issue tags: +Novice

Good catch! This does need to be fixed in the example code for that hook doc.
http://api.drupal.org/api/function/hook_entity_load/7

nvanhove’s picture

Component: documentation » system.module
Status: Active » Needs review
StatusFileSize
new633 bytes

Here's a patch.

Status: Needs review » Needs work

The last submitted patch, hook_entity_loaddocexample.patch, failed testing.

nvanhove’s picture

StatusFileSize
new633 bytes

and again, now hopefully with unix style newlines.

nvanhove’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, hook_entity_loaddocexample.patch, failed testing.

nvanhove’s picture

Status: Needs work » Needs review
StatusFileSize
new617 bytes

I hate newlines.

int’s picture

StatusFileSize
new640 bytes
dries’s picture

Status: Needs review » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)
Issue tags: -Novice

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