Maybe someone can come up with a better title. I get the following error message upon node creation (calling node/add/type) where thread notifications for this node-type are enabled:

warning: asort() expects parameter 1 to be array, null given in /var/www/drupal6/sites/all/modules/notifications_team/notifications_team.module on line 189.

I have a setup without Organic Groups using LDAP authentication and LDAP Groups for Single-Sign-On. The number of users that can be notified is around 140. Now in my case there are obviously no subscribers (I am just creating the thread) and I assume that $subscribers on line 185 is an empty array (I'm not a php specialist ... so I'm propably wrong). My fix for this issue was to check if $subscribers is empty or not:

Change line 182 from:
if (count($users) > variable_get('notifications_team_max_options', 20)) {
to:
if ((count($users) > variable_get('notifications_team_max_options', 20)) && $subscribers) {

Insert this to line 191:

else if((count($users) > variable_get('notifications_team_max_options', 20)) && !($subscribers)) {
  $acomplete = TRUE;
  $user_names = NULL;
}

Add an if-statement from line 226 to look like this:

if($subscribers) {
  $form['notifications_team']['options'] = array(
    '#type' => 'markup',
    '#value' => $user_names,
  );
} 

This is a very quick-and-dirty fix but seems to deliver the required behavior.
Thanks for your work on notifications_team !

Comments

Ian Ward’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.