When I press 'create' button with nodereference explorer (creating a referenced node) the node doesn't have the og group audience checkbox.
Can't get og context as that's what actually missing.
Options:
1. It's a bug and needs to be fixed
2. If i had the referencing node nid, i could get $_GET['gids'][0] maybe.
3. If i can alter the url with the button 'create' I could put gids into the url.
4. Can I create my own button that i can use instead of current 'create' button?
5. can we mix the functions with nodereference url.
6. Am i at the right direnction??
Are there any other options?
Anyone has any solution for this please?
Comments
Comment #1
bsandor CreditAttribution: bsandor commentedSome further thoughts:
If i do it my modalframe doesn't work.
I can't see where these functions were called so I can't pass any arguments to either.
It's a pretty complicated situation as of modules used.
Is there anyone who have some further ideas?
Comment #2
bsandor CreditAttribution: bsandor commentedhook_form_alter solves the problem half. With it i could insert previous group context onto my form. However i still don't have my full or proper integration with other modules.
I think group context needs to be set up earlier than hook_form_alter during form building process.
Anyways I used similar to following code in form_alter, it might be enough for someone:
case 'myformname_node_form': {
og_set_group_context (node_load($_SESSION['og_last']));
$form_state['og_gids'][0] = og_get_group_context () -> nid;
break;
}
Comment #3
bsandor CreditAttribution: bsandor commentedInstead of using hook_form_alter I modified nodereference_explorer.widget.inc: function nodereference_explorer_widget_process:
Changed line:
'create' => url(NODE_REFERENCE_EXPLORER_MENU_CALLBACK_CREATE .'/' . $field['widget']['dialog_api'] .'/'. $type_name .'/'. $field_name),
to:
'create' => url(NODE_REFERENCE_EXPLORER_MENU_CALLBACK_CREATE .'/' . $field['widget']['dialog_api'] .'/'. $type_name .'/'. $field_name, array ( 'query' => 'gids[]=' . og_get_group_context() -> nid ) ),
Now my system seems to be compatible with all my other modules as nodecreation process has OG gid.
Comment #4
gnindl CreditAttribution: gnindl commentedCommitted your proposal of #3 to the repository. Added additional checks if OG module is installed.
http://drupalcode.org/project/nodereference_explorer.git/commit/0075385