[OGF needs to be compatible with OG on 2.x] Wierd error after OG/Views 2 Update

ludo1960 - April 19, 2009 - 20:05
Project:OG Forum
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:paulbooker
Status:closed
Description

Getting this error in my OG forums after updating views 2 and OG to latest versions:

user warning: Unknown column 'oa.is_public' in 'field list' query: SELECT oa.nid, COALESCE(oa.is_public, 1) AS is_public FROM node n LEFT JOIN og_ancestry oa ON oa.nid = n.nid WHERE n.nid = 55 in /var/www/sites/all/modules/og_forum/og_forum.module on line 521.

Any ideas?

#1

ludo1960 - April 21, 2009 - 12:08

Anyone??

#2

Rustan - April 21, 2009 - 21:04

I have the same, shows up on forums with any comments in them.

#3

Rustan - April 21, 2009 - 21:13
Priority:normal» critical

I guess the column oa.is_public was removed in the latest version of OG, 6.x-2.0-rc1. That was the one I updated to just before this error appeared, and it changed a couple of tables.

#4

ignasiga - April 22, 2009 - 22:18

I have also this error, and it appeared when I upgraded to the latest version of OG (6.x-2.0-rc1).
It is explained in the release notes (http://drupal.org/node/429998) that the DB schema was changed in this particular aspect:

Factor the is_public column out of og_ancestry table and into a new og_access_post table that is 'owned' by og_access module. Add primary key to og_ancestry to prevent duplicate entries.

So I think that the check that is done to get sure that the node is public should be changed to be aware of the new DB schema.

#5

paulbooker - April 27, 2009 - 09:47

I'll only be fixing bugs against the 1.x branch of OG for the time being as my work commitments only require a working version of OG Forum against this branch . If anyone has the time to write a patch though to make the OG upgrade easy for OG Forum users that would be awesome!

Best, Paul

#6

paulbooker - April 27, 2009 - 09:48
Title:Wierd error after OG/Views 2 Update» [OGF needs to be compatible with OG on 2.x] Wierd error after OG/Views 2 Update

#7

wb54321 - May 6, 2009 - 18:20

OK, I'm a Newbie to Drupal and not a coder, so I imagine this will sound stupid. I need to have all my OG forums and posts remain private, but I still want to retain the ability to have public forums for anonymous users as well.

In the og_forum.module I changed the og_ancestry reference to og_access_post. I ended up with the same error message, only it stated og_access_post where it used to read og_ancestry. I also updated to the latest dev versions of OG and OG Forum. I know nothing about database schemas, tables or keys - but if a workaround doesn't show up soon I'll take a stab at learning. I'm fine with modifying code if there's a pre-written sample of new code for me to use, but creating new code from scratch is still beyond me. If I miraculously stumble across a way to fix this I will post it here.

When I'm done with the site I'm building, I will definitely donate some time to writing some comprehensive and newbie-proof OG documentation.

Update May 6, 2009: I decided to simply revert to the previous version of OG; much easier than trying to fix the OG Forum module. Meanwhile I'm looking for a stable alternative to OG Forum.

Bill

#8

batje - May 8, 2009 - 13:07
Version:6.x-1.4» 6.x-1.x-dev
Assigned to:Anonymous» batje
Status:active» needs review

around line 521 in the og_forum.module file change

$sql = "SELECT oa.nid, COALESCE(oa.is_public, 1) AS is_public FROM {node} n LEFT JOIN {og_ancestry} oa ON oa.nid = n.nid WHERE n.nid = %d";
to
$sql = "SELECT oa.nid, COALESCE(oa.og_public, 1) AS is_public FROM {og_access_post} oa WHERE oa.nid = %d";

only after upgrading to og 6.x-2.0-rc1

#9

ludo1960 - May 8, 2009 - 13:52

Error gone! Thanks for that.

#10

ignasiga - May 8, 2009 - 18:22

Hey, Fantastic!

Thank you a lot! I had a website to move on production tomorrow, so you solved the ugly warning thing!

I hope Paul will think for when to change the code to give the module full compatibility with OG 2.0

Thanks again for the query batje.

#11

batje - May 9, 2009 - 12:50

beware, there are a few more places where this code is used in the module. will update later (we go live on friday :-) )

#12

wb54321 - May 9, 2009 - 20:03

Worked for me too; many thanks batje!!! I hate to give up on the forums, I think they add a lot to the groups.

Lines 699 and 1028 also reference code similar to the patched code you fixed. If I could code I would try my hand at it, but I suspect the end result would be a broken module. :)

Thanks again!

#13

batje - May 15, 2009 - 13:22
Status:needs review» patch (to be ported)

As promised, its friday. So here is a patch that fixes the issue in all queries.

Please note, that there is now a dependency on the Organic groups access control Module. This patch does not update the .info file.

Please test before use, the other places where the query went off were pretty irregular, so i might have not actually hit them. (though i debugged the SQL in phpmyadmin.)

AttachmentSize
og-6x2.patch 4.15 KB

#14

batje - May 15, 2009 - 15:10
Status:patch (to be ported)» needs review

#15

paulbooker - May 17, 2009 - 15:48
Assigned to:batje» paulbooker

Reviewing patch

#16

paulbooker - May 17, 2009 - 16:24
Status:needs review» fixed

#17

System Message - May 31, 2009 - 16:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

#18

hansrossel - November 11, 2009 - 08:21
Status:closed» reviewed & tested by the community

#19

hansrossel - November 11, 2009 - 08:26
Status:reviewed & tested by the community» fixed

Sorry v2 was not active yet on my install, problem is there indeed gone.

#20

System Message - November 25, 2009 - 08:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.