When an authenticated user creates a new forum topic the name of the group is displayed wrong in the drop down 'Forums'.

The names of the forums (within the current group) are displayed correctly, but the name of the group is wrong, it is always the same group name displayed (and it is even a hidden admin group).

It is not crucial since the post ends up in the right group, but it is confusing for the user when he is choosing which forum he should post in and it looks like he is posting in the group 'Admin- development'.

For admin users everything works as expected.

Any ideas?

Thanks,
Seth

CommentFileSizeAuthor
#17 og_forum.module.patch885 bytesAnonymous (not verified)

Comments

rconstantine’s picture

Category: bug » support

Group names should not be appearing in the 'categories:forums' drop down. Rather, it should be populated with forum names for a given group, or the site-wide forums if you're at that level.

If you use a group's 'Create forum topic' link, then the module doesn't know which forum of that group you want to post to, so naturally, the first forum is selected. If, however, you first go to the group's forums, then drill down to a particular forum, then click the 'Add new forum topic' link (or whatever it says), then the correct forum is selected.

If, on the other hand you are referring to the group selection in the 'groups' fieldset and you have a drop down because you have too many groups for checkboxes, then I would guess that you didn't follow the README instructions to modify the OG module.

If none of this is correct, post a follow up message here.

seth97’s picture

Sorry, I didn't explain well....

I am only using forums in Organic Groups, no site wide forums. All forum posts have to be inside a group.

When I create a new forum topic in a group (I press the link 'Create forum topic' in the group home page).

I get a drop-down with the forums in the current group, where one forum is preselected, but the problem is that the name of the group is incorrect.

This is what I see in the drop down, for ex.:

- Please choose -
Admin group
-General discussion
-Other questions

The problem is that no matter what group I submit the forum topic in I always see the group name 'Admin group', but the names of the forums are displayed correctly.
Note that for site admin the group name are displayed correctly.

Thanks
Seth

seth97’s picture

Category: support » bug

Any news here?
Thanks!
Seth

rconstantine’s picture

What the heck? The group name should not be there at all under any circumstance. I have not been able to code anything for about a month due to work. I'm hoping to get to this module soon and it is the most pressing at the moment.

Sorry. You get what you pay for with open source! :-)

seth97’s picture

Ok, no problem, let me know if you have any clues on what has gone wrong in my case.

Thanks!
Seth

Anonymous’s picture

Assigned: Unassigned »

I couldn't reproduce the problem , any body else ?

seth97’s picture

Thanks for trying!
Do you know where the options of the drop down "Forums" is set?

Like I said before, somehow a name of a group is displayed here??? (not a name of a forum, but the name of a private group).

Thanks!

rconstantine’s picture

@Paul

I was able to reproduce this, but I couldn't figure out why. The names in the drop down should be populated by the og_forum_db_rewrite_sql function. Be careful when screwing with this. I have ideas for optimizing the queries, but right now they perform correctly.

Hmm. I just had a thought. I think that the screen shots I sent you were done on my test box and that is where the group name was present. If you see in the screen shots an entry in the forum drop down without a dash in front of it, then it shouldn't be there. I also think that I was using the latest production code in that install. Send me an email reminder to do a diff between the latest release and my production-deployed copy. I know that the issue is not showing up on my websites, so I'm wondering if I changed something and forgot to commit it.

Anonymous’s picture

@Ryan.

I can replicate this problem. Would you let me know please if you have a solution for this.

Thanks Paul

Anonymous’s picture

After spending some time this morning stepping through the code that generates the page node/add/forum&gids[]= the problem looks to be located between the line 1200 - 1212 of the OG Forum module

if (!user_access('administer forums')) {  
        foreach ($form['taxonomy'][$vid]['#options'] as $key => $the_rest) {
          if ($key == '') {
            continue;
          }
          reset($the_rest->option);
          $option_key = key($the_rest->option);
          if (!array_key_exists($option_key, $all_results)) {
            unset($form['taxonomy'][$vid]['#options'][$key]);
          }
          elseif (array_key_exists($option_key, $all_results) && $all_results[$option_key] == 0) {
            unset($form['taxonomy'][$vid]['#options'][$key]);
          }
        }//check to see if the audience is required or optional. if optional, don't do the following two lines

I'll update this ticket later this afternoon

Anonymous’s picture

The problem is definitely here ...

@1199 $form['taxonomy'][$vid] initially is as follows ..

Array ( 
[#type] => select 
[#title] => Forums 
[#default_value] => Array ( [0] => 57 ) 
[#options] => 
   Array (    
   [] => - Please choose - 
   [0] => stdClass Object ( [option] => Array ( [52] => A new group post "Organic Groups access control" installation / configuration ) ) 
   [1] => stdClass Object ( [option] => Array ( [53] => -General discussion ) ) 
   [2] => stdClass Object ( [option] => Array ( [56] => Another group to help with investigating group containers ) ) 
   [3] => stdClass Object ( [option] => Array ( [57] => -General discussion ) ) 
   [4] => stdClass Object ( [option] => Array ( [48] => forum_term_1 ) ) 
   [5] => stdClass Object ( [option] => Array ( [49] => forum_term_2 ) ) )  
[#description] => 
[#multiple] => 0 
[#size] => 0 
[#weight] => -10 
[#theme] => taxonomy_term_select [#required] => 1 ) 

then after some processing

@1212 $form['taxonomy'][$vid] is as follows

Array ( 
[#type] => select 
[#title] => Forums 
[#default_value] => Array ( [0] => 57 ) 
[#options] =>   
    Array (     
    [] => - Please choose - 
    [0] => stdClass Object ( [option] => Array ( [52] => A new group post "Organic Groups access control" installation / configuration ) ) 
    [3] => stdClass Object ( [option] => Array ( [57] => -General discussion ) ) )    
[#description] => 
[#multiple] => 0 
[#size] => 0 
[#weight] => -10 
[#theme] => taxonomy_term_select 
[#required] => 1 ) 

I am going to move on to other bugs so if someone wants to finish this , please do

Anonymous’s picture

Assigned: » Unassigned
Anonymous’s picture

Assigned: Unassigned »
Anonymous’s picture

Status: Active » Fixed

Fixed this problem. I'll get this out tomorrow in a further development release .

seth97’s picture

It works nice!

Thanks!

/Seth

seth97’s picture

Status: Fixed » Active

Hi!
This update seemed to have introduced a new error for the audience checkbox in OG.
After updating to the "5.x-2.x-dev 2008-Aug-13" it did not work to submit a content type in a group. The content was simply not associated with the group.
I moved back to the old version (1.5.2.1.2.6 2007/12/17) and everything works fine, except for the bug reported in this thread: Wrong Group name displayed in drop-down

Any ideas?

Thanks!

Anonymous’s picture

StatusFileSize
new885 bytes

Hi Seth,

There was a missing if block to check for a forum post .

Would you please apply the following patch to the most recent development release and confirm that fixes your problem.

Thanks for your patience.

Paul

Anonymous’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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

seth97’s picture

Status: Closed (fixed) » Active

Hi!
Sorry for my late reply. I had to change server and could not test.

It seems that the issue is resolved in the new release 5.x-2.2. Great!!

But there seems to be one problem related to #16:
If a 'site-admin' submits a content type in a group (other content type then forum topic) the audience is empty, meaning that the post is not associated with any group.
For authenticated users everything works fine!

Any ideas?
Thanks!

Anonymous’s picture

Status: Active » Closed (fixed)

Hey Seth,

Thanks for the follow up ..

"But there seems to be one problem related to #16:
If a 'site-admin' submits a content type in a group (other content type then forum topic) the audience is empty, meaning that the post is not associated with any group."

.. this has been resolved in 5.x-2.x-dev , ill have a new official release out by the end of the month.

Best, Paul