This is cut'n'pasted from 295727
Hi,
thanks, this looks like it's OK, but there are other patches pending....
I need: http://drupal.org/node/280355
I also found og_forums does not save the og ancestry correctly - I've patched mine to do this, I _thought_ I had seen somebody else's patch, or submitted the patch... but I can't find it now... does it ring any bells?Basically, this sort of thing (It could be neater!)
function og_forum_save_ancestry($node,$gid,$public) {
if (og_is_omitted_type($node->type)) { // only do this if it's an ommited type!!!
$sql = "DELETE FROM {og_ancestry} WHERE nid = %d";
db_query($sql, $node->nid);
$sql = "INSERT INTO {og_ancestry} (nid, group_nid, is_public) VALUES (%d, %d, %d)";
db_query($sql, $node->nid, $gid, $public);
}
}Then it needs to be called in the node api hook if the type of an og type, and your doing an insert or an update....
From memory - and it's a while ago I looked - the problem is that when you (re-)save a og_forum node that should be held within a group, it "drops" the identity with that group.
In other words, if you want og_forum pages to be know their group (group targeting), then you need this...
Hope that helps
Cheers
Mark.
Comments
Comment #1
Anonymous (not verified) commentedThanks for all your help Mark,
I will look into that tomorrow morning
Best, Paul
Comment #2
Anonymous (not verified) commentedTaking a look at this today ...
Comment #3
Anonymous (not verified) commentedI couldn't reproduce the problem .
Comment #4
markfoodyburton commentedHi
I'm happy to mark this as closed for the time being ... It's a while ago, and I'm not sure exactly how (or why) I had a problem
It may be because I'm using og_forums a little 'strangely'
I use an og_forum group as a sort of todo-bug tracker... so anyone (whos registered) can submit a forum post, it gets emailed to the forum (good), people can reply (+- some hacks to make replies go back to the initial author as well) - but the forum posts now belong to the 'group' to which they were submitted rather (or as well as) to the forum.... so to make this all work, the permissions mechanism for the forums stuff had to be adjusted (from memory), and only then did I see this bug.... I think that adjustment to the permissions stuff (to make forums private to the group etc) was a different patch that I think you did ages ago.... not 100% sure... Oh dear, I'm loosing my marbles :-)
But - as I say, it's a while ago... :-(
Cheers
Mark.