So far everything works perfectly using the organic groups module. Even in views, aside from og_handler_filter_user_roles.

When trying to filter user roles the following error message is displayed, and it does not allow me to continue editing the view. I most likely have to delete the view from the database manually and then recreate it.

Is this bug by chance exclusive to MSSQL? Any help would be much appreciated. The complete error message is below:

PDOException: SQLSTATE[42000]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Column 'og_role.rid' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.: SELECT r.*, r.name AS _field_0 FROM {og_role} r GROUP BY r.name; Array ( ) in og_handler_filter_user_roles->get_value_options() (line 14 of C:\inetpub\wwwroot\sites\all\modules\og\includes\views\handlers\og_handler_filter_user_roles.inc).

CommentFileSizeAuthor
#3 i2097539.patch627 bytesattiks
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

NWOM’s picture

Issue summary: View changes
Status: Active » Needs review

I fixed the issue by changing Line 13 in the og_handler_filter_user_roles.inc

From

->groupBy('r.name')

to

->groupBy('r.name')->groupBy('r.rid')->groupBy('r.gid')->groupBy('r.group_type')->groupBy('r.group_bundle')

mbnsorg’s picture

We are also seeing this issue for MSSQL, although it is working okay on MySQL site.

Not sure if there is a difference between listing all the fields in the groupBy() or removing the groupBy() altogether. I am going to try removing it.

attiks’s picture

attiks’s picture

Priority: Major » Critical

Changing to critical since it breaks the view when using something else than mysql