One of my users discovered a bug in og2list (both HEAD and 4.7 branches). There is no code in hook_nodeapi() when $op='update' to process the 'recipient' ($node->og2list_ml) value, but the text box to enter it still appears when a node does not have a recipient set yet.
The attached patch goes into og2list_nodeapi() right after case 'update':
case 'update':
/* If the node previously did not have an address and one has just been assigned,
* then we need to set it now. If the node did have an og2list_groups row before
* then the recipient wasn't set and we update it. For now you still cannot change
* a recipient once it's set.
*/
if ($node->recipient &&
(db_num_rows(db_query("SELECT recipient FROM {og2list_groups} WHERE nid = %d",$node->nid)) == 0)) {
db_query("INSERT INTO {og2list_groups} (nid, recipient, status) "
. " VALUES(%d, '%s', 1)", $node->nid, $node->recipient);
}
// existing update logic continues here
This allows the Mailing List Address field to be filled in if a list has not been set yet, but prevents og2list trying to insert it when the row already exists (and $node->recipient is a hidden value containing its address).
The attached patch is for HEAD. It should also apply to 4.7 but I'll attach a backported patch for DRUPAL-4-7 in a comment.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | og2list_edit_existing_group_add_recipient_4.7-1.x.patch | 1.29 KB | damien_vancouver |
| og2list_edit_existing_group_add_recipient_HEAD.patch | 1.28 KB | damien_vancouver |
Comments
Comment #1
damien_vancouver commentedHere is the patch again, for version 4.7-1.x in CVS.
Comment #2
killes@www.drop.org commentedapplied to both branches
Comment #3
(not verified) commented