Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#2 | apachesolr_og-skip_anonymous_users-2136391-2.patch | 1.35 KB | KeyboardCowboy |
apachesolr_og-check-for-anonymous.patch | 1.91 KB | BarisW |
Comments
Comment #1
japerryTested and looks good. Added to the commons patches until committed to apachesolr_og.
Comment #2
KeyboardCowboyThe 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.