A strange one.
Users have been reporting that their posts disappear from the group after they edit those. I confirmed that once user edits a forum-topic associated with a group, the audience is set to public. Troubling.
This only happens with forum-topics and not other content-types so I'm guessing this is og_forum related.
Anybody had this? I would obviously be very happy for a solution to this problem.
Fili
Comments
Comment #1
rconstantine commentedQuestion: is it 'changed' to public, or is it given BOTH the group and public audiences? If only public, I think it would disappear from the group forum altogether, so that's how you'd check. If the public box is simply being checked without your permission without UNCHECKING the existing audience, that's something that shouldn't be too hard to track down.
Please check this and get back to me.
Comment #2
fiLi commentedThanks for getting back to me.
Just like I said - what ever Audience was set is changed to public, so it's only public and doesn't show up on the group page anymore. It seems that for users there is a blank "Group" selection box (it shows "Groups" but with no groups in there), which is actually different than how it looks for events and other content where it shows the default group selected. So this isn't the users changing this by mistake, this is caused automatically after edit.
I'm assuming this only happens to me. Were you able to recreate this problem in your install?
Fili
Comment #3
rconstantine commentedOkay, I'm getting to this now. I confirm the issue. It may be related to the og issue I posted here: http://drupal.org/node/177626
If so, I'll just have to include the code and instructions in the README to patch OG if Moshe won't add the change as I've written it. I understand that he isn't convinced that I've properly identified the problem and come up with the right solution, but in my installations, this is working great.
Part of the problem is my fault. I'm not sure what line it is in the released version since I've changed my copy, but if you comment out the line that reads:
$form['og_nodeapi']['visible']['#access'] = 0;you should no longer have an empty groups fieldset!
Sorry about that.
So I'll investigate this, but I suspect that the two things I just mentioned combined to cause your issue. Please attempt to apply both code changes to your install and let me know if it works. Meanwhile, if I find something else that is obviously causing this, I'll fix it and let you know.
Comment #4
rconstantine commentedOkay, I just tested things, and it appears that the two changes above work. I am able to create posts (the audience is shown, but not changeable, and the public box is unchecked) and then edit it (the options don't change) and can browse to the post through the forum.
So I will definitely add the above-mentioned og issue to the README and include the three lines of code that should be added and instructions on where to add it. I'm not going to include a patch as such so that this should be able to be applied to any future version of OG - i.e. line number changes won't matter. I'll also create a closed issue with expanded instructions that I'll refer to in the README.
Comment #5
rconstantine commentedComment #6
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #7
fiLi commentedI'm sorry, but I'm re-opening this issue.
The OG patch and above code (which is integrated in the new release) doesn't do the job.
The groups are visible, but the audience is still set to public when the forum topic is edited. Which means that for the topic to stay in the group, the owner has to go through the list of groups he's part of (which could be a long one) and select the group it was part of before. My suggested behavior would be to only display the group it's part of the option "public" with the group selected by default.
This suggested behavior is what I get with the rest of events and weblinks that are running in the groups, so this is a forum-topic issue. Can you look into this again?
(BTW - I don't get why we have a different method for handling audience than the other group content types. This is cause for trouble...)
-
Another issue, which keeps coming back in every new OG-forum release, is that when a group name is edited, the forum name is changed and loses it's container. I've previously removed the "update:" piece of code to prevent that from happening, but every time I install the new OG-forum release, I need to remember to do it. I can open a new issue for this, if you should so want me to.
-
Thanks in advance,
Fili
Comment #8
rconstantine commentedOK. As someone else was having a different issue with OG audience being an optional thing, so I decided to try and reproduce your problem with that setting. And you're right. The checkboxes are unchecked. So now I know where to look. I suppose you have good reason to not create a faux site-wide group so that you could work around this by making audience required, but if not, that is one thing you could do for now until I track this down.
As to your comment that started "BTW", the very good reason to handle things differently is due to the fact that forums reside within groups and to allow a post of a given group forum to not be placed in that forum would jack things up. This, of course, applies only when a user browses to a group forum, not when they create a forum topic at the site-wide level and place it somewhere. However, I think the behavior of the latter is not quite as it should be and I'm sorry to say that since my own installations all have audience set to 'required', it just hasn't been a priority of mine. But I do believe I have a task/issue here in the queue as a reminder - i.e. auto set the group audience based on the forum selection.
As for the name change issue, what should happen is that the group container, which, upon group creation is given the name of the group, should have its name changed to reflect the new group name. Since tids are not changed, there should not be a problem. I thought I tested this pretty well, but if you are saying that a name change to a group changes the container name and orphans the forums, then open a new issue. However, what you describe seems to indicate that the forum names are changes, and not the container name, so that would be super-puzzling.
Comment #9
rconstantine commentedLooking at the code, this is what is happening. When audience is set to be required, I automatically choose the group the user is posting from and set it as the #value, rather than the #default_value. Although I agree that the UI in your case needs to have the box checked, what should happen as things now stand when you submit an edited page is - nothing. Nothing should change. The group is correctly listed in the array as the #value. You can use the devel form_inspect module to see that.
Try commenting out
unset($form['og_nodeapi']['visible']['og_groups']['#default_value']);around line 1118.And do me a favor. Before you comment out that line, edit a group forum topic, save it, and see if it is still in a) the right forum, and b) that the group context menu pulls up the right group's stuff.
Comment #10
rconstantine commentedBTW, can anyone tell me if there are any consequences for having both #value and #default_value set? Does one override the other? I expect that #value overrides and so simply commenting out the line I mentioned will show the correct box checked, but will not allow changes.
Another question: Until I get the auto-group-assign feature done, should we allow users to even see the audience selection during node edit? Or would it be better to hide it since a change would orphan the node from the group context, but keep it in the forum?
If you switch to a required audience for a few minutes and edit one of your forum topics, you will see that all that the user is shown is a text message telling them what the audience is set to, followed by the public box.
Comment #11
fiLi commentedThanks for taking the time to address this.
Well, I followed you suggestion on #9 and that didn't work. But, then, reading your second message, I thought about trying to comment the three lines in question :
And, surprisingly, that seems to do the trick. Audience is preserved when editing. Don't know what's the side-effects of this, and whether this will cause problems with other functionality (it's probably there for a reason...). Let me know...
Comment #12
rconstantine commentedRight. My comment in #10 means that for your setting of an optional audience, I should conditionally apply what you did in #11, otherwise if audience is required, the code should not be commented. I'll mark this as patch needs review to remember to put this in next chance I get. Thanks for testing.
Comment #13
rconstantine commentedchanging title to reflect outcome.
Comment #14
rconstantine commentedAdded to my copy of the module, so this will be in the next release.
Comment #15
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.