When I tried to post in the group forum it showed the message

You must join a group before posting on this web site.

CommentFileSizeAuthor
#13 555964.patch3.26 KBdazweeja
#12 glen201_modules.pdf147.53 KBglen201

Comments

andrenoronha’s picture

Title: Don't alow users to post » Doesn't alow users to post
glen201’s picture

Version: 6.x-2.0-rc4 » 6.x-2.x-dev

-dev as well! When the Forum topic is configured as a group post and you click Create Forum Topic from the Group block.

I tried to see if maybe it was the context of posting when in the group that was messing up, so navigating to the Create content /node/add page directing then clicking Forum topic causes another problem: there are no Group forums listed in the drop down menu (and it's a mandatory field).

This is not a group permissions thing, because I can post other nodes flagged as group posts into my groups.

--glen

dazweeja’s picture

What version of Organic Groups (not OG Forums) are you using?

glen201’s picture

I tried with RC4 and -dev.

Is there some place in the permissions table I can look to see if everything is set okay?

dazweeja’s picture

I meant Organic Groups itself, not this module. I can't recreate this problem so I'd be interested to know which combination of OG and OG Forums is causing it.

andrenoronha’s picture

I'm using OG 6.x-2.0

glen201’s picture

Same

glen201’s picture

@dazweeja - any ideas so we can get OUR site up, too? This is getting a little nuts.

Anonymous’s picture

I can't replicate this problem with OG & OG Forum.

dazweeja’s picture

I can't replicate it either but I can see issues with/potential improvements to both og_forum_db_rewrite_sql and og_forum_form_alter which may solve the problem.

@a.luiz.n and glen201, can I ask a few more quick questions:

1. Do you get the message directly after clicking Create Forum Topic or is it when you click submit on the new forum topic form?
2. What is the url for the Create Forum Topic, ie. when you hover over the text 'Create Forum Topic', does it say something like /node/add/forum?gids[]=1?
3. Lastly, what are your settings for 'Audience checkboxes' and 'Audience required' in the Group Details fieldset of /admin/og/og?

andrenoronha’s picture

@dazweeja

1. only when i click submit.
2. i made my own link to the create forum topic. so it's the same link i used before: <a href="/node/add/forum/'.$fid.'?gids[]='.$node->nid.'">
3. Audience checkboxes: not checked. Audience required: required.

glen201’s picture

StatusFileSize
new147.53 KB

@dazweeja

1. The problem occurs when I click submit on a new forum topic, as group organizer or member; administrator works. Interestingly, the error doesn't show UNTIL all required fields are satisfied (unlike regular OG nodes if you don't have permission to enter them, it says immediately upon entering node/add that you must join a group to post.
2. Create forum topic shows : http://localhost/node/add/forum?gids[]=76
3. Audience checkboxes not checked; Audience required: set as required

If it would help, I have copies the text from my modules page and uploaded it as a PDF file, in case you see that I have something installed that is conflicting.

-- glen

dazweeja’s picture

StatusFileSize
new3.26 KB

@a.luiz.n and @glen201:

This patch (against current 6.x-2.x-dev) should solve the primary issue. I'll fix the secondary issue, ie. drop-down not populated, soon (see below).

@Paul, don't commit yet as og_forum_db_rewrite_sql still needs to be patched (to fix issue where no forums appear in drop-down when gids is empty). When gids is empty I think the drop-down should be populated with all forums accessible to current user. I also think a validate function should be added so that the forum post is associated with correct group if it's moved to another forum outside the current group (eg. if a new forum post is created from a page where gids is empty - only possible when og_forum_db_rewrite_sql is patched - or by a user with 'administer forums' permissions). I'll have a go at this soon.

On another issue, adding og_forum.js always has the effect of disabling the 'Public' checkbox as $('input.og-audience-forum').val() is never true. Is this intended behaviour?

Anonymous’s picture

Assigned: Unassigned »

Looking into this now ...

Anonymous’s picture

Status: Active » Reviewed & tested by the community

Verified audience problem & patch looks good.

I'll get this work committed later this week.

Best, Paul

glen201’s picture

@dazweeja THANKS much for that fix ... og_forums is now 90% there, as group members are now able to post successfully.

However, there appears to be a problem with publicity of private forums within a group -- if I make a forum private, the forum name still shows up for those who are not members of the group (i.e., they can see that a forum exists and what it's name is, but it shows no public posts).

I don't think it worked that way before the patch. Do you see that too?

Setting Automatic Forum Publicity or not setting it doesn't change anything. If I click Reset Publicity that doesn't change anything either. Users who are not logged in cannot see any forums, regardless of publicity, which for my particular site is working properly, but that may not be good for others.

-- glen

kentr’s picture

@glen201

Looks like #16 is a separate issue. Is that correct? I'm guessing it would help in the management of the original issue here if #16 were posted in a new issue.

kentr’s picture

When gids is empty I think the drop-down should be populated with all forums accessible to current user.

Agreed. The dropdown seems to work fine (as User 1) when any value is passed for gids, so I'm thinking the issue is here in og_forum_db_rewrite_sql() (about Line 416):

    if (arg(0) == 'node' && arg(1) == 'add' && arg(2) == 'forum' && !$_GET['gids']) {
      $return['join'] = "LEFT JOIN {og_term} ogt ON t.tid = ogt.tid";
      $return['where'] = "ogt.nid IS NULL";
      if ($og_forum_container = variable_get('forum_default_container', FALSE)) {
        $return['where'] .= " AND t.tid != $og_forum_container";
      }
      $return['distinct'] = TRUE;
      return $return;
    }

I'm wondering if the whole thing can be wrapped with a test on forum_default_container_yn so that the above block only executes when the forum_default_container_yn is enabled.

Gonna test that now.

Anonymous’s picture

@ kentr

Thanks for you help. It looks as though we could have our official 2.x release out by Friday :-)

dazweeja’s picture

I was thinking - but I haven't had time to do it yet - that the code should be something like:

<?php
  if (arg(0) == 'node' && arg(1) == 'add' && arg(2) == 'forum' && !empty($_GET['gids'])) {
    $accessible_tids = get_accessible_tids();
    $return['where'] = "tid in (" . explode(',', $accessible_tids) . ")";
    $return['distinct'] = TRUE;
    return $return;
  }
?>

Where get_accessible_tids is a helper function that gets all tids not associated with a group plus all public tids and those that the current user has access to minus the default forum container if it exists.

kentr’s picture

@dazweeja

Cool. My idea didn't work. It returned all terms under the forum vocabulary, regardless of group membership.

I was playing with a more complex query that joined on og_uid as well, but hadn't gotten it yet. I think your idea is a cleaner solution, but maybe less optimized b/c it requires a second query to get the accessible tids.

Can we do this with a single query?

Anonymous’s picture

Please discuss any further problems in new bugs, thanks.

Would you also describe any additional problems in as much detail as possible so that i
can reproduce easily.

Best, Paul

kentr’s picture

Started a new issue at http://drupal.org/node/580452.

Anonymous’s picture

Status: Reviewed & tested by the community » Closed (fixed)