Hi
I wonder if somebody had the experience to use pop up reference with OG module. My basic problem that by the creation of new node which belongs to specific group 'gid' is passed in the web address in the node, which affects the audience checkboxes (or if they are deactivated, the node automatically belongs to the passed group). I have a node reference field (CCK) in the node. My problem is that when I try to add new node through pop up reference, the newly created node does not belong to any group. I suppose that here should be a way how to take the gid from the node which is still not created ?

Comments

starbow’s picture

Category: support » feature

Interesting issue. I suspect it would take some custom coding to solve this.

kansaj’s picture

a temporally solution (wokrs logicaly only if audience is required and new node)

$all_types = node_get_types();
foreach ($field['referenceable_types'] as $type => $value) {
if (!empty($value) && user_access("create $type content")) {
if ($_SERVER["REQUEST_METHOD"] == 'GET') {
$gids = $_GET['gids'];
}
elseif ($_POST['og_groups_hidden']) {
$gids = unserialize($_POST['og_groups_hidden']);
}
$gids=$gids[0];
$path = "node/add/". strtr($type, '_', '-');
$links[] = l("Add ". $all_types[$type]->name, $path, array('class' => $pclass), "destination=node/add/" . strtr($src_type, '_', '-')."&gids[]=".$gids);
}
}

markfoodyburton’s picture