This code should check for a module_exists() on Message or commons_ativity_streams before creating a message.
/**
* Implements hook_node_update().
*/
function commons_wikis_node_update($node) {
if ($node->type == 'wiki') {
$account = user_load($node->uid);
$message = message_create('commons_wikis_wiki_updated', array('uid' => $account->uid, 'timestamp' => $node->updated));
$wrapper = entity_metadata_wrapper('message', $message);
// Save reference to the node in the node reference field.
// We use a multiple value field in case we wish to use the same
// field for grouping messages in the future
// (eg http://drupal.org/node/1757060).
$wrapper->field_target_nodes[] = $node;
$wrapper->save();
}
}
Comments
Comment #1
ezra-g commentedMoving this to the main Drupal Commons issue queue per #1812492: Consider using central issue queue for Commons projects.
Comment #2
jpontani commentedCommitted a fix.
Comment #3
ezra-g commentedThis code should check for a module_exists() on Message or commons_ativity_streams before creating a message.
Comment #4
jpontani commentedCommitted a fix.
http://drupalcode.org/project/commons_wikis.git/commit/01d5fc39857aee43a...