Install og.module.
On admin/og/og > "Node authoring form" make sure "Audience checkboxes" is unchecked.
Give a role the permission to create a content type. Story for example.
Create a user and add it to multiple groups.
Login as that user and go to the group home page.
The group block appears, select "Create Story".
You see "Audience:" and the group name you are creating a Story for. You cannot choose other groups.
Click Preview.
Now several group check boxes are visible and you can select multiple groups.

This is inconsistent with the first screen you get to see. Shouldn't the screen stay the same?

Comments

jax’s picture

StatusFileSize
new99.92 KB

The screenshot after you hit preview.

skor’s picture

I get this too.

And a possibly related artifact: If I skip the preview, the post does not get displayed on the group page. Then if I edit the content, the audience checkbox is not checked.

skor’s picture

Took a tip from this issue, and went to Administer>>Organic Groups>>Organic Groups config>>Node Authoring Form and set Audience: Required.

That fixed it for now.

jax’s picture

StatusFileSize
new93.41 KB

If I put it to required it only changes that I get an error about it (see screenshot).

One fix is to replace:

  if ($_SERVER["REQUEST_METHOD"] == 'GET') {
    $gids = $_GET['gids'];
  }

in og_form_add_og_audience() by:

$gids = @$_REQUEST['gids'];

That does it for me but it's not the correct fix. I think the problem is that this form element:

$form['og_nodeapi']['invisible']['og_groups'] = array('#type' => 'value', '#value' => drupal_map_assoc($groups));

is not picked up after the submit. It has also dissapeared from $form.

recidive’s picture

Version: 5.x-1.x-dev » 4.7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new617 bytes

The problem is with that check:

if ($_SERVER["REQUEST_METHOD"] == 'GET') {
   $gids = $_GET['gids'];
};

The $gids array is passed by the query string, but it doesn't pass the above check when the form is submitted, so $gids is not instantiated, causing the error.

To reproduce this you need to configure og's node authoring form with 'Audience checkboxes' disabled, 'Audience required' as required and have a normal (authenticated user with the required permissions to post on a group) with at least 2 group subscriptions. Then try to create a node (page, story, etc) using the og details block.

I'm attaching a patch to fix this for 4.7 but this also affects the 5.x versions of og.module.

Luca Lenardi’s picture

I have the same problem on drupal 5.
I also noticed that when "Audience checkboxes" is checked, og doesn't write anything on the "node_access" table.

moshe weitzman’s picture

Version: 4.7.x-1.x-dev » 5.x-1.x-dev
Status: Needs review » Needs work

I can reproduce this now, but I'm too tired to figure it out. The audience code has become too complicated for my taste. I am considering removing the option to disable the audience checkoxes and always showing them. This 'simple' mode is a real headache in the code.

The proposed patch won't work. It won't let you deviate from the gids that are pased on the querystring, even after a preview.

moshe weitzman’s picture

Status: Needs work » Fixed

i added some more crufty code to handle this. hopefully i got it right. this code is stinkyand must be exorcised. yell now if you really like the simple mode that 'audience checkboxes' disabled is important to you.

jax’s picture

Well, I don't want my users to be able to modify the group a message was posted to. So the group checkboxes should never be visible. I think the only way that is possible is with that simple mode....

moshe weitzman’s picture

This mode is not intended as access control for audience form element. It is a UI simplification, and can be worked around. If you want people to be able to edit posts but not edit audience, you need a custom module with hook_form_later() to enforce that.

somebodysysop’s picture

StatusFileSize
new18.58 KB

What's going on with this? Just downloaded and installed og.

Went to Administer › Organic groups › Organic groups configuration

Configured "Node authoring form".

1. Enable "Audience checkboxes"
2. Under "Visibility of posts", ticked on "Visibility chosen by author/editor using a checkbox on the posting form. Checkbox defaults to Public."
3. For "Audience required:", ticked on "optional"

But, when I go to "create->page", there is a checkbox for each page, but no Public access checkbox, and the content is available to all users. What do I need to do to fix this?

somebodysysop’s picture

StatusFileSize
new35.66 KB

Oh, man, this is wierd!

Just for the heck of it, I went back to Home » Administer » Organic groups -> Node authoring form, and selected under

Visibility of posts:
Visible only within the targeted groups

When I go back to create -> page, I now see the "Public" box.

I have attached both screens. This must definately be a bug!

I just downloaded and installed this version today: http://ftp.osuosl.org/pub/drupal/files/projects/og-5.x-1.0.tar.gz

Help!

Anonymous’s picture

Status: Fixed » Closed (fixed)