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

webchick - May 20, 2006 - 21:25
Assigned to:Anonymous» webchick

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

#2

webchick - May 20, 2006 - 21:41

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

lectric - May 20, 2006 - 21:51

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

#4

webchick - May 21, 2006 - 02:25

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?

AttachmentSize
og.module_11.patch1.08 KB

#5

webchick - May 21, 2006 - 02:25
Status:active» patch (code needs review)

#6

RobRoy - June 13, 2006 - 19:17

Fixes my problem. +1

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

#7

moshe weitzman - June 13, 2006 - 21:04
Status:patch (code needs review)» patch (code needs work)

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

#8

moshe weitzman - June 15, 2006 - 01:43

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

#9

webchick - June 15, 2006 - 03:13

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

moshe weitzman - June 15, 2006 - 13:22

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

#11

ncatchpole - June 23, 2006 - 10:05
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.

#12

ncatchpole - June 23, 2006 - 10:25
Title:Also getting this issue» patch worked

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

#13

Heine - June 23, 2006 - 10:28
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.

#14

ncatchpole - June 23, 2006 - 10:44

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

#15

elraun - July 6, 2006 - 22:17

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

elraun - December 13, 2006 - 23:55

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.

#17

Andrupal - January 1, 2007 - 04:21

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.

 
 

Drupal is a registered trademark of Dries Buytaert.