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.

CommentFileSizeAuthor
#4 og.module_11.patch1.08 KBwebchick

Comments

webchick’s picture

Assigned: Unassigned » webchick

I swear I have already fixed this once... will look into it.

webchick’s picture

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?

Evan Leeson’s picture

I have an out-of-date version. I'll upgrade the module.

webchick’s picture

StatusFileSize
new1.08 KB

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?

webchick’s picture

Status: Active » Needs review
RobRoy’s picture

Fixes my problem. +1

Worthy of an commit I think. Can't see a reason to leave it out.

moshe weitzman’s picture

Status: Needs review » Needs work

the right place to add the DISTINCT is in og_db_rewrite_sql()

moshe weitzman’s picture

I can't reproduce this. i am logged in as a standard user

webchick’s picture

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.

moshe weitzman’s picture

I am using mysql5. surprising that this makes any difference. is that a mysql bug?

ncatchpole’s picture

Title: Posting to a group and to Public results in double post in group » Also getting this issue

I'm also getting this issue on a testing site - with the latest 4.7.0 and CVS. Running mysql 4.0.24.

ncatchpole’s picture

Title: Also getting this issue » patch worked

sorry for double post. webchick's patched worked fine when applied to cvs version of og.module

heine’s picture

Title: patch worked » Posting to a group and to Public results in double post in group

Please be careful; changing the title changes the title of the issue.

ncatchpole’s picture

sorry! my first post to an issue, now I know! Thanks for picking me up on it

ron collins’s picture

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.

ron collins’s picture

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: i'm not satisfied yet. is views summary not using db_rewrite_sql()? if it is, the distinct should be getting added. i wan to know why before adding code that seems to mask a bug.

Andrupal’s picture

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.

leamas’s picture

I am getting this duplication error and I do not know exactly where you are putting DISTINCT.
I don't see any function called og_get_home_nodes_sql.

digidoo’s picture

...same issue here with recent version 6.x-1.4
The duplications of group nodes on ghp are only visible to group members.

Anyone any clue ?

Wuekkie’s picture

Version: 4.7.x-1.x-dev » 6.x-2.0

Ditto here with 6.x-2.0. Anonymous and admin, 1 listing, any other roles, groups are listed twice.

davidmolliere’s picture

Subscribing.

I have the exact same issue, every post marked as public is listed twice on the group page.

BillyIdle’s picture

I have a similar problem that I think is related:

I am a maintainer of a fairly large site with almost 30 different content types, where some of these are group posts. All nodes posted in a group are set to public. We have a view with exposed filters for listing content on the site. After a major upgrade of the system nodes started to show up twice in the view (the Distinct flag for the view is set to "No").

After investigating the case, this is what I found: The nodes that show up twice are those that are posted into a group that the user is member of. I even tried posting a node to two groups that the test user is member of, and then it shows up 6 times.

Further investigation shows this was not not fixed by downgrading to og 1.3 or upgrading to 2.0, but is related to the drupal core version being updated from 6.13 to 6.14.

RWWood’s picture

Ditto here. A non-superAdmin who creates a group sees it listed twice under his "My groups", and if he posts in the group, he sees the post twice. If I create a group or post as Admin, I only see the group or post listed once.

moshe weitzman’s picture

Status: Needs work » Closed (fixed)

the 6.14 issue is a core problem. there is a dupem in this queue as well.

Smallwolf’s picture

So at this point there is no work around for this issue?

Tarsjusz’s picture

Same problem. Is there any other solution than DISTINCT in select?

ggevalt’s picture

Subscribing.

We have the same issue on our test site -- would like to resolve before implementing on our live version. Anyone know of a work around or patch being tested?

Additional info:
core 6.14
og 6.x-1.4
og content type admin 6.x-1.2

Firewolf’s picture

Subscribing.

Same problem on one of our project websites.

core 6.14
og 6.x-2.0

Tarsjusz’s picture

After upgrading views to 6.x-2.7 even solution with DISTINCT stopped working :|

Ether’s picture

Component: og.module » Og Views

subscribe, as I have the same issue.

marcp’s picture

Please test the core patch in #284392: db_rewrite_sql causing issues with DISTINCT (comment #257) and respond in that queue.

greg.harvey’s picture

Latest patch is now #298, and I confirm it fixes the issue.
http://drupal.org/node/284392#comment-2282634