This module is part of Drupal Commons. In Commons, one can enable the Events SOLR Search page.
If you visit that page anonymously, you get the following errors:

Warning: Invalid argument supplied for foreach() in apachesolr_og_get_my_groups_filter() (line 59 of /profiles/commons/modules/contrib/apachesolr_og/apachesolr_og.module).
Notice: Undefined variable: search_groups in apachesolr_og_get_my_groups_filter() (line 65 of /profiles/commons/modules/contrib/apachesolr_og/apachesolr_og.module).

The patch fixes this.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

japerry’s picture

Status: Needs review » Reviewed & tested by the community

Tested and looks good. Added to the commons patches until committed to apachesolr_og.

KeyboardCowboy’s picture

The previous patch uses user_is_anonymous() which has some flaws. See #327230: user_is_anonymous() is ugly. I rerolled the patch to use !user_is_logged_in() instead and also cleaned up some variable declarations and casting that could otherwise throw similar warnings to the one reported in this issue.