Closed Bug 422323 Opened 16 years ago Closed 16 years ago

Forums posts disappear from group homepage on edit

Categories

(Websites Graveyard :: spreadfirefox.com, defect, P1)

All
macOS
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: alix, Assigned: cpollett)

References

()

Details

Attachments

(1 file, 1 obsolete file)

When spreadfirefox users (this does not happen for admin users) edit their own forums posts, the posts disappear from the group's main page.

To reproduce the problem:
1. Post a new forum post in a project group. The post shows up on the group's main page.
2. Go to the forum post.
3. Click Edit.
4. Click Submit. You don't actually have to make any changes.

After you click submit the post disappears from the project's main page."
Taking this one .
Assignee: ian-bugzilla → paul
The reason the post is lost is that on submit the post is then assigned to no group and is not publicly accessible so you get an access denied page if you try to load the page later explicitly, unless you login as administrator then you can see the post.

On the edit page the groups block is missing so if i can resolve this problem it should resolve the above problem.

Investigating ..

Paul
Still working on this .

It's a problem with OG Forum

With OG Forum enabled if you navigate to a group and then to the "Submit discussion" page you will see the Forums for that group (good) but you cannot select a group from 'Groups' or see that it's selecting the correct group (bad) but it nevertheless posts the discussion to the group correctly . When you go to edit the post you have just created you have the same problem with 'Groups' but this time when you submit your post has gone from the group and if you try to load the page directly you get "Access denied".

But with OG Forum disabled and you go to create a "Discussion Topic" then "Forums" will list all forums and the "Group" section  shows the audience and public checkbox correctly.

So the problem is with OG Forum.

We have the latest version of the OG Forum module on our server .

Currently been looking at the bug reports on http://drupal.org/project/og_forum
and i can't find a patch to fix this problem so it looks as though ill need to investigate fixing this problem on my local machine 

Paul
I would recommend changing this to Severity: Major loss of function
I have located the problem to the following lines of the og_forum module
function

function og_forum_form_alter($form_id, &$form) {

..
$form['og_nodeapi']['visible']['og_groups']['#value'] =
$form['og_nodeapi']['visible']['og_groups']['#default_value'];
unset($form['og_nodeapi']['visible']['og_groups']['#default_value']);
$form['og_nodeapi']['visible']['#access'] = 0;
..

}

this is undoing what is correctly done by the following lines of the og module
function

function og_form_add_og_audience($form_id, &$form) {
..
 $form['og_nodeapi']['visible']['og_groups_visible'] = array('#type' => 'item',
'#title' => t('Audience'), '#value' => $item_value);
      $assoc_groups = drupal_map_assoc($groups);
      // this hidden element persists audience values during a Preview cycle.
avoids errors on Preview.
      $form['og_nodeapi']['invisible']['og_groups_hidden'] = array('#type' =>
'hidden', '#value' => serialize($assoc_groups));
      // this 'value' element persists the audience value during submit process
      $form['og_nodeapi']['invisible']['og_groups'] = array('#type' => 'value',
'#value' => $assoc_groups);

..

}


Please feel free to look at this if anybody wants to investigate further .

I'll continue with this in the morning.

Paul
Please would you review the patch that fixes this problem .

I am going to talk with the og_forum project maintainer so that i can understand the problem better and so that i can be sure that i have not caused other problems in fixing the current problem.

Thanks Paul
Attached patch og_forum patch (obsolete) — Splinter Review
Attachment #309095 - Flags: review?(morgamic)
Assignee: paul → spreadfirefox-com
Assignee: spreadfirefox-com → morgamic
Any problems with the patch ?
Priority: -- → P1
Paul - seems that you should talk to the og_forum maintainer first before just commenting out random blocks?

Could it be that the default og_forum group isn't publicly viewable?
Looking into this now . I'll update shortly.
Assignee: morgamic → paul
Hi Micheal

I have not commented out random blocks i have commented out specific blocks and there is a rationale for commenting out these specific blocks.

If you experiment with lines 721-723 the following can be observed .

1. If you comment out line 723 
$form['og_nodeapi']['visible']['#access'] = 0;
then you can see the group section on the "Submit Discussion Topic" page so 
og_forum group isn't showing the group section publicly for authenticated users

2. If you comment out lines 721/722
$form['og_nodeapi']['visible']['og_groups']['#value'] = $form['og_nodeapi']['visible']['og_groups']['#default_value'];
then you see the correct group preselected when you edit a discussion topic. 

I did post a message to the maintainer a while ago but go now reply but we can try again. Ill do that now.

The problem with OG Forum that has been fixed for 5 weeks or so and really should be pushed to production.

-Paul Booker 
Assignee: paul → morgamic
Nothing back form the project maintainer
http://drupal.org/node/247439

Do you want me to leave this with you to resolve or shall we push the fix through to production ?

-Paul Booker
Hi Alex,

Can i get permission to push these changes through to subversion. It looks as though the maintainer of the og_forum module has these changes in her working copy only.

http://drupal.org/node/247439#comment-816557

I'll then do some final testing on the staging server.

-Paul Booker 
Assignee: morgamic → polvi
Paul, please hold on pushing he changes. We need to fix other bugs first, then we can add this one. I'm meeting with cpollett from webdev today, to come up with a schedule for this. 
Understood Alex.

Thanks
Paul Booker
Attachment #309095 - Flags: review?(morgamic) → review?(cpollett)
Assignee: polvi → paul
Hi Chris,

Would you let me know when i can push these changes through to subversion. 

I'll then do some final testing on the staging server.

Regards
Paul Booker 
Assignee: paul → cpollett
Comment on attachment 309095 [details] [diff] [review]
og_forum patch

Rather than comment out line delete them. Let's try to avoid polluting the code too much with commented out stuff and rely on svn to keep track of that. Otherwise, seems reasonable. Post a new patch and will look at quickly.
Attachment #309095 - Flags: review?(cpollett) → review-
Attached patch og_forum patchSplinter Review
Here is the new patch as requested , thanks .
Attachment #309095 - Attachment is obsolete: true
Attachment #321148 - Flags: review?
Attachment #321148 - Flags: review? → review?(cpollett)
Comment on attachment 321148 [details] [diff] [review]
og_forum patch

this patch works for me. Thanks for your help Paul.
Attachment #321148 - Flags: review?(cpollett) → review+
hey paul when you check this in make sure to post the revision number here so I
can close this bug.
Committed revision 13234.

Thanks again Chris :-)
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Product: Websites → Websites Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: