OG and pop up

kansaj - February 24, 2009 - 11:28
Project:Popups: Add and Reference
Version:5.x-1.0-beta2
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

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 ?

#1

starbow - February 24, 2009 - 17:52
Category:support request» feature request

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

#2

kansaj - April 1, 2009 - 13:22

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

markfoodyburton - September 17, 2009 - 20:57
 
 

Drupal is a registered trademark of Dries Buytaert.