oa_messages_create() is defined as follows:
oa_messages_create($message_type, $entity = NULL, $entity_type = 'node', $text = '', $args = NULL, $uid = NULL, $send = TRUE)
When oa_messages_create() is called with $entity = NULL and $entity_type = 'node', the code will fail at the following lines:
if (!empty($entity_type)) {
// Since this can be called on node_update / insert, we clear the entity
// cache so that it gets the values assigned by other modules.
entity_get_controller($entity_type)->resetCache(array($entity_wrapper->getIdentifier()));
}
At this point, $entity_wrapper is NULL but because of $entity_type = 'node' the if() is entered anyway.
Comments
Comment #2
jorrit commentedComment #3
mpotter commentedLooks like some other changes got mixed into this patch. Not sure why you removed the user_load($uid) argument from the call to message_create(). That is needed when messages are created from a different user ($uid argument passed to oa_messages_create).
Comment #4
jorrit commentedYou're right, I forgot to undo changes for another issue.
Comment #5
jorrit commentedComment #6
jorrit commentedFixed the patch.
Comment #7
mpotter commentedFixed in oa_core d96395e.