You are here

function og_update_group in Organic groups 6.2

Same name and namespace in other branches
  1. 5.8 og.module \og_update_group()
  2. 5 og.module \og_update_group()
  3. 5.2 og.module \og_update_group()
  4. 5.3 og.module \og_update_group()
  5. 5.7 og.module \og_update_group()
  6. 6 og.module \og_update_group()

On update of a group node, or if a node becomes a group, save group data.

1 call to og_update_group()
og_nodeapi in ./og.module
Implementation of hook_nodeapi().

File

./og.module, line 1525
Code for the Organic Groups module.

Code

function og_update_group($node) {

  // If an existing node becomes a group, then a row may not be present in {og} table.
  $sql = "SELECT nid FROM {og} WHERE nid = %d";
  if (db_result(db_query($sql, $node->nid))) {
    drupal_write_record('og', $node, array(
      'nid',
    ));
  }
  else {
    og_insert_group($node);
  }
}