Duplicate items on og_ghp_ron when marked as "Public"

jdtart - September 24, 2009 - 14:49
Project:Organic groups
Version:6.x-2.0
Component:og.module
Category:bug report
Priority:critical
Assigned:Unassigned
Status:duplicate
Issue tags:multiple content, multiple row in og
Description

For items that are created in a group, if the "Public" checkbox is selected, then that item appears twice in the og_ghp_ron. I am not sure why, I have looked at the view and cannot determine why this would occur. It did not occur on D-5.15, but when I upgraded to D-6.14, it started.

#1

BenStallings - November 5, 2009 - 20:21
Version:6.x-1.3» 6.x-2.0

I'm having this problem with 6.x-2.0, and equally at a loss to explain it. Any ideas?

#2

BenStallings - November 5, 2009 - 20:23
Category:support request» bug report

changing to a bug report, in case that will help it get attention.

#3

jdtart - November 6, 2009 - 04:47

Another piece of information, but still no solution... when logged in as admin (user 1) or as the group admin, this behavior does not seem to be occurring for me. Only when logged in as a standard group member do I see the duplicates!

#4

markuskb - November 11, 2009 - 06:29
Priority:normal» critical

I also have this problem, it can be reproduced by these steps:

- install Drupal (6.14) (and database, of course)
- enable Page and Blog as content type, set view & create permissions for authenticated users
- install og 6.x-2.0
- install views 6.x-2.7
- enable modules "Organic groups", "Organic groups access control", "Organic groups Views integration", "Views", "Views UI"
- go to Administer - "Organic groups" - "Organic group configuration" and define "Page" as "Group node" and "Blog entry" as "Wiki group post (any group member may edit)"
- in "Organic group configuration", select the options "New groups don't ... directory exclusively", "New groups don't ... form exclusively", "Required"
- go to Administer - Organic groups - Organic groups access configuration and select "Visible within the targeted groups and on other pages." and "New group home pages and default audience are always public."
- create a user, log in with that account and create a Page (which is a group).
- go to "/og/my" and now you will see two entries for your created group. Only groups which the current user has created will be shown as duplicate.

This should be the query which was generated for displaying the groups:

SELECT node.nid AS nid, node.title AS node_title, users.name AS users_name, users.uid AS users_uid FROM node node LEFT JOIN og_uid og_uid ON node.nid = og_uid.nid INNER JOIN users users ON node.uid = users.uid INNER JOIN node_access na ON na.nid = node.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'og_public') OR (na.gid = 1 AND na.realm = 'og_admin'))) AND ( (node.status <> 0) AND (node.type IN ('page')) AND (og_uid.uid = 3) )ORDER BY node_title ASC LIMIT 0, 50

Raising priority because this case has been open since September.

#5

kristyb2008 - November 10, 2009 - 03:42

I've been testing out OG 6.x-2.0 and I experience the same issue. For any view for the currently logged in user who creates content I see a duplicate entry for every node created. However, if I log out, or login as a non-author of the node I don't see duplicates. Any idea as to when this issue will be dealt with?

#6

kristyb2008 - November 10, 2009 - 23:31

Actually I'm even experiencing this issue with 6.x-1.4. It seems as though when OG Views module is enabled it creates all of the duplicate entries. Even though only one node is being created the views is showing two for the currently logged in user who created the node and group.

#7

markuskb - November 11, 2009 - 06:40

Actually, it's the SQL query fetching the result to display which seems to be the cause. The data saved in the DB is not duplicated. In my above example, if you strip the

(na.gid = 0 AND na.realm = 'og_public')

from the OR clause, the groups are shown correctly.

Unfortunately, selecting "Distinct" in Views doesn't help for the affected views - the SQL keyword "DISTINCT" which is supposed to show up in the related query is mysteriously stripped away.

#8

mathieu - November 11, 2009 - 21:03

Having similar issue, albeit with nodes associated to group. Trying to figure it out better, but this started happening after upgrade from og 1.x to 2.0. Subscribing...

EDIT: Issue fixed for me, was actually caused by #284392: db_rewrite_sql causing issues with DISTINCT.

#9

markuskb - November 12, 2009 - 06:23

mathieu,
thank you for the link - it fixed also the issue for me!

Here's the link to the patch which worked for me:
http://drupal.org/node/284392#comment-2187006

#10

kristyb2008 - November 12, 2009 - 15:07

Thanks! I can confirm that the patch works for me also.

#11

mathieu - November 12, 2009 - 15:26
Status:active» duplicate

Changing to duplicate... Can you guys go to the other issue and update it with success stories? :-)

#12

markuskb - November 13, 2009 - 08:32

Sure mathieu, did so! :)

#13

PraetorianFX - November 14, 2009 - 22:42

this duplicate entry row come with permission Administration node, but i dont like it if authorize user set to "administer nodes permission" is enable... may day may daay..

Subcribe..

#14

marcp - November 14, 2009 - 23:46

See #621274: Core bug - Group manager sees their group twice in <site>/og listing which will point you to the core issue mentioned above: #284392: db_rewrite_sql causing issues with DISTINCT where the latest patch is at comment #257.

 
 

Drupal is a registered trademark of Dries Buytaert.