Forums posts disappear from group homepage on edit

RESOLVED FIXED

Status

P1
normal
RESOLVED FIXED
11 years ago
7 years ago

People

(Reporter: alix, Assigned: cpollett)

Tracking

Details

(URL)

Attachments

(1 attachment, 1 obsolete attachment)

561 bytes, patch
cpollett
: review+
Details | Diff | Splinter Review
(Reporter)

Description

11 years ago
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."

Comment 1

11 years ago
Taking this one .
Assignee: ian-bugzilla → paul

Comment 2

11 years ago
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

Comment 3

11 years ago
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

Comment 4

11 years ago
I would recommend changing this to Severity: Major loss of function

Comment 5

11 years ago
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

Comment 6

11 years ago
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

Comment 7

11 years ago
Created attachment 309095 [details] [diff] [review]
og_forum patch
Attachment #309095 - Flags: review?(morgamic)

Updated

11 years ago
Assignee: paul → spreadfirefox-com

Updated

11 years ago
Assignee: spreadfirefox-com → morgamic

Comment 8

11 years ago
Any problems with the patch ?

Updated

11 years ago
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?

Comment 10

11 years ago
Looking into this now . I'll update shortly.
Assignee: morgamic → paul

Comment 11

11 years ago
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

Comment 12

11 years ago
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

Comment 13

11 years ago
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

Comment 14

11 years ago
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. 

Comment 15

11 years ago
Understood Alex.

Thanks
Paul Booker

Updated

11 years ago
Attachment #309095 - Flags: review?(morgamic) → review?(cpollett)

Updated

11 years ago
Assignee: polvi → paul

Comment 16

11 years ago
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
(Assignee)

Comment 17

11 years ago
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-

Comment 18

11 years ago
Created attachment 321148 [details] [diff] [review]
og_forum patch

Here is the new patch as requested , thanks .
Attachment #309095 - Attachment is obsolete: true
Attachment #321148 - Flags: review?

Updated

11 years ago
Attachment #321148 - Flags: review? → review?(cpollett)
(Assignee)

Comment 19

11 years ago
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+
(Assignee)

Comment 20

11 years ago
hey paul when you check this in make sure to post the revision number here so I
can close this bug.

Comment 21

11 years ago
Committed revision 13234.

Thanks again Chris :-)
(Assignee)

Updated

11 years ago
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
Product: Websites → Websites Graveyard
You need to log in before you can comment on or make changes to this bug.