Project:Popups: Add and Reference
Version:5.x-1.0-beta2
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

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

#1

Category:support request» feature request

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

#2

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);
}
}

#3

nobody click here