Mailing list can only be set up when node is created, not updated
dkruglyak - June 13, 2007 - 08:29
| Project: | Organic groups list manager |
| Version: | 4.7.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | reviewed & tested by the community |
Description
A trivial oversight, og2list_nodeapi neglects to process list setup field on 'update' case. The fix is to copy the same code from 'insert' case:
if (og_is_group_type($node->type)) {
if (isset($node->recipient) && strlen($node->recipient) && $node->nid) {
$count = db_num_rows(db_query("SELECT nid FROM {og2list_groups} WHERE nid = %d",$node->nid));
if ($count && $count > 0) { // an old row exists, delete it.
db_query("DELETE FROM {og2list_groups} where nid = %d",$node->nid);
}
db_query("INSERT INTO {og2list_groups} (nid, recipient, status) VALUES (%d, '%s', 1)", $node->nid, $node->recipient);
}
}