I can't get the og_group_ref set in a node form rendered via a custom block My block code is as follows:

mymodule_block_info() {
  $blocks = array();
  $blocks['my_contenttype_form_block'] = array(
    'info' =&gt; t('My CustomContentType Add Form'),
    'cache' =&gt; DRUPAL_CACHE_PER_PAGE,
  );
  return $blocks;
}

function mymodule_ui_block_view($block_name = '') {
  global $user;
  switch ($block_name) {
    case 'my_contenttype_form_block':
  module_load_include('inc', 'node', 'node.pages');
  // Create a node for the content type.
  $node = new stdClass();
  $node-&gt;uid = $user-&gt;uid;
  $node-&gt;name = (isset($user-&gt;name) ? $user-&gt;name : '');
  $node-&gt;type = 'my_contenttype';
  $node-&gt;language = LANGUAGE_NONE;

  $block = array(
    'subject' =&gt; t('Create New CustomContentType record'),
    'title' =&gt; t('Create New CustomContentType record'),
    'content' =&gt; drupal_get_form('my_contenttype_node_form', $node),
  );
    break;
  }

  return $block;
}


The "Groups audience" field is missing. It shows up in the standard add page (mysite.com/node/add/my_contenttype). 

I've tried setting this programmatically via hook_form_alter, and also by setting the $form_state['values']['og_group_ref'][0], but nothing seems to work (although it makes sense that these approaches are failing when the field isn't even in the form.

Thanks in advance for the assist!
Any thoughts as to why it's missing?
For the benefit of others, I realized the user was not a member of the child group they were trying to add content to. They were members of the parent, but that didn't allow them to add content to the child group in question, so permissions didn't propagate as expected. There is an OG subgroups module (https://drupal.org/project/og_subgroups) which is supposed to help with this, but I wasn't able to configure it correctly for some reason before realizing that this particular application required the user to be a member of the subgroup in order for them to actually post.