User warning error at admin/og/og_multiple_mandatory_groups_by_role/groups

kyle.vh - October 16, 2008 - 21:53
Project:Organic Groups - Multiple Mandatory Groups by Role
Version:6.x-1.3
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

I installed mandatory groups, then deleted it. (readme suggests deleting specific tables--might this help?)
Then, installed multiple mandatory groups.
Then I navigate to: admin/og/og_multiple_mandatory_groups_by_role/groups, where I get the below error, and the 'Open or Closed Groups' drop down contains NO groups. I have about 10 groups/subgroups.

* user warning: Unknown column 'o.selective' in 'where clause' query: SELECT n.nid, n.title, o.* FROM node n INNER JOIN og o ON n.nid = o.nid WHERE (o.selective = 3 OR o.selective = 0) ORDER BY n.title in /home/focus/www/www/sites/all/modules/og_multiple_mandatory_groups_by_role/og_multiple_mandatory_groups_by_role.module on line 645.
* warning: Invalid argument supplied for foreach() in /home/focus/www/www/includes/form.inc on line 1417.

#1

pwolanin - October 21, 2008 - 22:53
Project:Organic Groups Mandatory Group» Organic Groups - Multiple Mandatory Groups by Role
Version:6.x-1.0-beta1» 6.x-1.x-dev

sorry - I don't know anything about that module. The error you're seeing looks like a query not updatd for the 6.x version of OG.

#2

bejam - October 27, 2008 - 21:43

I'm getting this error too, and nothing listed in "open or closed groups"

#3

sunescan - October 28, 2008 - 15:35

I've the same error!!!

Anyone knows the solution???

Thanks!

#4

sunescan - October 29, 2008 - 08:14

Well, I think I resolved the issue:

in the line 645 of og_multiple_mandatory_groups_by_role.module I changed:

$option_result = db_query("SELECT n.nid, n.title, o.* FROM {node} n INNER JOIN {og} o ON n.nid = o.nid WHERE (o.selective = %d OR o.selective = %d) ORDER BY n.title", OG_CLOSED, OG_OPEN);

for:

$option_result = db_query("SELECT n.nid, n.title, o.* FROM {node} n INNER JOIN {og} o ON n.nid = o.nid WHERE (o.og_selective = %d OR o.og_selective = %d) ORDER BY n.title", OG_CLOSED, OG_OPEN);

I think the trouble was that the o.selective table doesn't exist, the correct name is o.og_selective.

Maybe anyone can check the solution is correct.

Regards!

#5

kyle.vh - October 29, 2008 - 18:44

Thanks for this post. I'm going to try it out. I'll tell ya'll how it went.

kyle.

#6

kyle.vh - October 29, 2008 - 19:04

Fixed the errors instantly, nice catch.
I still haven't played w/ the module much, though.
Thanks so much Sunescan.
k

#7

sunescan - October 30, 2008 - 10:19

Hello,

can you try to delete an existing group from:

administer-groups-multiple mandatory groups by role --> Available Groups --> 'delete' or 'delete and unsubscribe'

I'm having an error in this point :(

Thanks!

#8

AFowle - November 13, 2008 - 11:52
Version:6.x-1.x-dev» 6.x-1.3

I have the same problem with later software. I'll try the correction later. (Behind a corporate firewall at present and can't poke the code)

Organic Groups - Multiple Mandatory Groups by Role 6.x-1.3
Organic groups 6.x-1.0-rc8

#9

AFowle - November 13, 2008 - 21:35

After the query correction shown above, I needed to change this in the next line or so

switch ($group->selective) {
case OG_OPEN:
$options[$group->nid] .= ' | ' .t('Open group, users can unsubscribe.');
break;
case OG_CLOSED:
$options[$group->nid] .= ' | ' .t('Closed group, users can not leave.');
break;
}

to

switch ($group->og_selective) {
case OG_OPEN:
$options[$group->nid] .= ' | ' .t('Open group, users can unsubscribe.');
break;
case OG_CLOSED:
$options[$group->nid] .= ' | ' .t('Closed group, users can not leave.');
break;
}

This seems to work

Still getting errors at line 840 or so when deleting , but can work round them .

#10

lee20 - February 1, 2009 - 04:56

And here is a patch including the fixes mentioned by sunescan (#4) and AFowle (#9).

This patch does NOT resolve the errors "when deleting" mentioned by AFowle in #9.

AttachmentSize
322342.patch 1.34 KB

#11

lee20 - February 1, 2009 - 04:56
Status:active» needs review

#12

dtarc - March 4, 2009 - 10:50

This patch is a duplicate of the patch at Db error on setting available groups.

 
 

Drupal is a registered trademark of Dries Buytaert.