Comments

ezra-g’s picture

Project: Commons Wikis » Drupal Commons
Component: Code » Wikis

Moving this to the main Drupal Commons issue queue per #1812492: Consider using central issue queue for Commons projects.

jpontani’s picture

Component: Wikis » Code
Assigned: Unassigned » jpontani
Status: Active » Needs review

Committed a fix.

ezra-g’s picture

Status: Needs review » Needs work

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();
  }
}
jpontani’s picture

Status: Fixed » Closed (fixed)

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