it would be nice to have access to the publishing / revisioning options when creating a node the same as editing. Currently, the code looks for the node object in the form to find the gids for the node, which is correct for edit. If you are using entityreference_prepopulate when adding group content then it would also be possible to determine whether or not the publishing / revisioning options should be available.

I was able to do this in mymodule_form_alter with the following lines, which are almost an exact copy of the form_alter that og_moderation uses with the exception of the 3rd line:

if (isset($form['#node_edit_form'])) {
    if ($form['#node_edit_form'] && og_is_group_content_type('node', $form['#bundle'])) {
      if (!isset($form['#node']->nid) && isset($form['og_group_ref']['und']['#default_value'])) {
        foreach($form['og_group_ref']['und']['#default_value'] as $gid) {
          if (og_user_access('node', $gid, "access publishing options of " . $form['#bundle'] . " content")) {
            $form['options']['#access'] = TRUE;
          }
          if (og_user_access('node', $gid, "access revisions options of " . $form['#bundle'] . " content")) {
            $form['revision_information']['#access'] = TRUE;
          }
        }
      }
    }
  }

Perhaps this is a little too custom to be a fully supported feature, but I thought I would post it at least for consideration or for anyone else that may run into the same issue.

Comments

shenzhuxi’s picture

Status: Active » Fixed

already committed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.