Closed (fixed)
Project:
OG Read Only
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
3 May 2009 at 16:35 UTC
Updated:
19 May 2009 at 18:30 UTC
When a node is edited and saved it is automatically added to groups to which the user is a member but should not have write permission. The problem is that group nids are being added to $form['og_invisible']['og_groups_inaccessible'] by og_read_only which actually forces the node to be added to the controlled groups rather than preventing them being added, which is what og_read_only should be doing. Removing this code solves the problem:
// Create or merge list of inaccessible groups
// if (count($inaccessible_groups)) {
// if ($form['og_invisible']['og_groups_inaccessible']) {
// $form['og_invisible']['og_groups_inaccessible'] = array('#type' => 'value', '#value' => $inaccessible_groups);
// }
// else
// {
// $form['og_invisible']['og_groups_inaccessible'] = array_merge($form['og_invisible']['og_groups_inaccessible'], $inaccessible_groups);
// }
// }
Comments
Comment #1
John Hodgins commentedThe above was a hasty solution. A much better solution is to not remove the code above, abut instead to check if the group was already selected (in og_initial_groups) before adding it to og_groups_inaccessible. So slightly higher in the 'Group checkboxes' section as these conditionals:
Comment #2
yrocq commentedCommited in CVS. Thanks !
Comment #3
yrocq commented