1
I was trying to work out why I could not modify the settings for a user's groups or even my own. I found the following two lines and the one I needed to 'comment out'/remove in /modules/profile/admin/user.php.
149: $new_groups = isset($_POST['groups']) ? $_POST['groups'] : array();
150: //$user->setGroups($new_groups);
The reason it needs commenting out is because below that is a section that checks the difference between the current array of groups and the new set
156: $cur_groups = $user->getGroups();
158: $added_groups = array_diff($new_groups, $cur_groups);
159: $removed_groups = array_diff($cur_groups, $new_groups);
So if line 150 has set the groups already when we call $user->getGroups(); on line 156 $cur_groups will already be the same as $new_groups and because there is now no difference the groups will not be inserted/removed
I am too buggered finding that to track down the sql issue found when triggering a save op in the same page (saving settings for instance) The error is as follows
SELECT COUNT(*) FROM fcn_group_permission WHERE (gperm_modid = '1' AND gperm_name = 'module_admin' AND gperm_groupid IN () AND gperm_itemid = '2')
Error number: 1064
Error message: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND gperm_itemid = '2')' at line 1
( 0.000362)
Stuart.