Posting to a group and to Public results in double post in group
lectric - May 20, 2006 - 20:30
| Project: | Organic groups |
| Version: | 4.7.x-1.x-dev |
| Component: | og.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | webchick |
| Status: | patch (code needs work) |
Description
I posted an item to a group and selected "public" as well since I want that item to be viewed via other links on my website. It works as expected. The item shows up on the home page, as well as in the group, but it appears in the group twice. It does not appear in other groups, which is good.

#1
I swear I have already fixed this once... will look into it.
#2
Hm. I can't duplicate this, using the most current version of OG 4.7 (line at the top of og.module reads: // $Id: og.module,v 1.110.2.84 2006/05/17 18:27:15 weitzman Exp $)
Can you confirm this is the version you're using? If so, could you detail the steps you're doing to get this behaviour?
#3
I have an out-of-date version. I'll upgrade the module.
#4
Confirmed this is still an issue, on client's site anyway (so maybe a difference between MySQL 4 (duplicates the nodes) vs. 5 (doesn't)?). And indeed, my DISTINCT in og_get_home_nodes_sql from rev. 1.154 got wiped in rev. 1.174. Here's a patch to add it back in, which fixes the problem.
Moshe, was this removed for a reason?
#5
#6
Fixes my problem. +1
Worthy of an commit I think. Can't see a reason to leave it out.
#7
the right place to add the DISTINCT is in og_db_rewrite_sql()
#8
I can't reproduce this. i am logged in as a standard user
#9
Moshe, are you using MySQL 4 or MySQL 5? I wasn't able to reproduce either locally (PHP5+MySQL5) but definitely confirmed it on lectric's site.
#10
I am using mysql5. surprising that this makes any difference. is that a mysql bug?
#11
I'm also getting this issue on a testing site - with the latest 4.7.0 and CVS. Running mysql 4.0.24.
#12
sorry for double post. webchick's patched worked fine when applied to cvs version of og.module
#13
Please be careful; changing the title changes the title of the issue.
#14
sorry! my first post to an issue, now I know! Thanks for picking me up on it
#15
this was still an issue for me in the latest 4.7 (// $Id: og.module,v 1.110.2.99 2006/06/18 17:54:37 weitzman Exp $)
the patch fixes the problem. i'll default to moshe here but i don't see how it could be fixed in og_rewrite_sql as he suggested.
#16
there was a duplicate issue here http://drupal.org/node/88344 (which i have now closed) where i had posted a workaround for this a while ago which seems to work but moshe wanted a different solution.
moshe:
#17
I've had the same issue using $Id: og.module,v 1.110.2.158 2006/12/20 08:09:39 m3avrck Exp $ as well as all its recent precursors...
I added DISTINCT to the two queries in function og_get_home_nodes_sql and the problem went away.
FYI I'm using mySQL 5.0.24, if it matters.