I have content types where I want some types of users to post at the site global level. When I try to add one of these types, my group options are only:
* Post to specific groups
* Post to contacts (private)
How can I make a post without having to assign to a group? Checking "Post to specific groups " and leaving the group blank does not work. I don't want to remove these fields for this type of user, because they may want to post to a group or trusted contacts. How would you recommend doing this? Or is it a bug?
I have tried to make a patch to fix this, but it does not recognize the change. (the git repo setup has changed?). I had to add this to my theme's template.php (the group_audience_type is not available when trying to alter in a module).
if (isset($form['group_audience_type'])) {
$form['group_audience_type']['#options']['public'] = 'Public';
$form['group_audience_type']['#default_value'] = 'public';
}
Then in commons_trusted_contacts.module - line 943, could you change the else to:
else if ($group_audience_type == 'custom') {
Otherwise I get an error on $wrapper->{OG_AUDIENCE_FIELD}->set($group_ids);
Comments
Comment #1
RobKoberg CreditAttribution: RobKoberg commentedOr could we change this test:
to be based on a custom permission. The could be something like:
"create content site-side"
Comment #2
RobKoberg CreditAttribution: RobKoberg commentedre-titling
Comment #3
RobKoberg CreditAttribution: RobKoberg commentedI don't think the test in commons_trusted_contacts.module and the commons_trusted_contacts_form_add_privacy_toggle function is working correctly. When trying to do a similar test in my template.php form_alter there was never a default value at $form[OG_AUDIENCE_FIELD][LANGUAGE_NONE][0]['default']['#default_value'] or $form['og_user_group_ref'][LANGUAGE_NONE][0]['default']['#default_value'] even though the value is set correctly in the DB.
This seems to be a bug now.
I had to do it from the node attached to the form to get correct values:
Also can you put in the test to ensure we can override the either or behavior with og_access enabled of having to post to either private contacts or to a group (
else if ($group_audience_type == 'custom') {
). This should not affect the behavior of either having og_access enabled or not.Comment #4
RobKoberg CreditAttribution: RobKoberg commentedStill having problems with this. No matter what I try to do to add a public option, it always saves as 'private' for trusted contacts. That is, I cannot seem to save a group content node without some group context. We were able to do this until recently, right?
This is critical for us.
Is there somewhere else that is forcing 'private'. In debugging, I am seeing the value of $group_audience_type is set to 'public' in the commons_trusted_contacts_node_presave function, so it would seem that it is not getting set in the commons_trusted_contacts_node_presave function. Where else could this be happening?
Here is my submit handler:
Comment #5
RobKoberg CreditAttribution: RobKoberg commentedUsing the hook_node_update and insert in a module (does not get called in the theme's template.php??). dpm'ing the node, I can see I have empty arrays for OG_AUDIENCE_FIELD and og_user_group_ref. Any ideas how to fix?
Comment #6
ezra-g CreditAttribution: ezra-g commentedRetitling as a feature request, since what's described here isn't part of the currently intended functionality in Commons.
@RobKoberg, are you able to file your proposed code changes above as a patch so that we can review it?
Comment #7
ezra-g CreditAttribution: ezra-g commentedThis is a duplicate of #2020061: Allow users to create content outside of groups.
Comment #8
Leopold-2 CreditAttribution: Leopold-2 commentedimportant feature - should be implemented!