See this part of the function og_form_add_og_audience() (line 2081 ff.):
elseif ($cnt = count($options, COUNT_RECURSIVE)) {
// show multi-select. if less than 20 choices, use checkboxes.
$type = $cnt >= 20 || $is_optgroup ? 'select' : 'checkboxes';
$form['og_nodeapi']['visible']['og_groups'] = array(
'#type' => $type,
'#title' => t('Audience'),
'#attributes' => array('class' => 'og-audience'),
'#options' => $options[t('My groups')],
'#required' => $required,
'#description' => format_plural(count($options[t('My groups')]), 'Show this post in this group.', 'Show this post in these groups.'),
'#default_value' => $groups ? $groups : array(),
'#required' => $required,
'#multiple' => TRUE);
}
In the code of the current version only $options is used. The [t('My groups')] is missing.
Without the 'My groups' it is not possible to select a group!
Comments
Comment #1
MichaelK-1 commentedAfter some more tests it occurs that the [t('My groups')] is only necessary for users who are not members in all groups. For users who are members in all groups this key is unset. So an if-then-else is the solution.
Comment #2
MichaelK-1 commentedSo, this is the working code:
Comment #3
MichaelK-1 commentedAnd last but not least, here is the patch against the head file
Comment #4
moshe weitzman commentedHow do I reproduce the problem? Is user editing own post or that of someone else? Is user an admin? The fix looks like it is coding around a problem.
Comment #5
ashiwebi commentedI want to know whether your change applicable for removing the checkbox and implementing the multiple select option in OG module
Comment #6
kasiawaka commentedI have the same problem: if user belongs to more then one group, the Audience list of groups is empty when user tries to create any content in the group.
I described it here http://drupal.org/node/573656#comment-2403062 because the problem was related to the module OG Content Type admin - when disabled, everything went back to normal.
Comment #7
jvieille commentedIt seems that the problem reappeared in OG 2.0.
When a user creates a node from a group context, the audience is limited to that group even if the user is subscribed to other groups. If logged as admin, however, all groups are displayed for selecting audience.
This is the code on og.module in OG 6x-2.0
Comment #8
jvieille commentedRecall of the issue:
- when a (non admin) user who is member of several groups creates a new post or edit an existing one, he cannot select the audience apart of "Public"
- The administrator can select any group for a node audience.
Comment #9
Grayside commentedComment #10
jvieille commentedThis is most certainly an OGCTA problem as mentioned in #6 by kasiawaka
http://drupal.org/node/573656