User warning error at admin/og/og_multiple_mandatory_groups_by_role/groups
| 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 |
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
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
I'm getting this error too, and nothing listed in "open or closed groups"
#3
I've the same error!!!
Anyone knows the solution???
Thanks!
#4
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
Thanks for this post. I'm going to try it out. I'll tell ya'll how it went.
kyle.
#6
Fixed the errors instantly, nice catch.
I still haven't played w/ the module much, though.
Thanks so much Sunescan.
k
#7
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
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
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
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.
#11
#12
This patch is a duplicate of the patch at Db error on setting available groups.