Active
Project:
Popups: Add and Reference
Version:
5.x-1.0-beta2
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Feb 2009 at 11:28 UTC
Updated:
17 Sep 2009 at 20:57 UTC
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
Comment #1
starbow commentedInteresting issue. I suspect it would take some custom coding to solve this.
Comment #2
kansaj commenteda 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);
}
}
Comment #3
markfoodyburton commentedSee
http://drupal.org/node/580736
Cheers
Mark.