I don't know how to explain it better, so just try this to reproduce the issue and it will be clear:
1) Create a group with a lot of users in it (for instance 20).
2) Set notifications_team to change from checkbox to select when the group is bigger than 15 people.
3) Post a message to the group and try to add 19 members to the dropdown.

So summarizing: When the notifications change to a "select" (dropdown instead of checkboxes), if you select for instance 10 usernames (more than a line) the next username is not shown in the dropdown... so you don't know who are you adding to the list.

I'm trying to fix this adding the users to the begging of the dropdown instead of the end... or better than this, let the dropdown show just one username by value instead of the long list with the former ones.

Sorry for the wired explanation... as you will notice, English is not my mother tongue.

CommentFileSizeAuthor
#2 notifications_team.module.patch579 bytesmbria

Comments

mbria’s picture

Ok. I finally found the solution.

Version: 6.x-2.1-beta8
File: notifications_team.module
Line: 775.
Fixing: Remove $prefix variable from $matches at the autocomplete function.
Result: The drop down just show one user, so you can add as many users as you like.

function notifications_team_autocomplete($oggroup = 0, $notify = '') {
  // The user enters a comma-separated list of destinations. We only autocomplete the last tag.
  $array = split(',', $notify);
  foreach ($array as $key => $entry) {
    $array[$key] = trim($entry);
  }

  $string = trim(array_pop($array));
  $matches = array();
  if ($string) {
    $prefix = count($array) ? implode(', ', $array) .', ' : '';
    foreach (notifications_team_get_users($string, 10, $oggroup) as $user) {
      $display = isset($user->plaintext) ? $user->plaintext : check_plain($user->name);
      $matches[$prefix . $user->name] = $display; // $display . $prefix; <---------- Remove $prefix variable.
    }
  }
  drupal_json($matches);
}

Sorry, but now I can't submit a patch.

mbria’s picture

Status: Active » Patch (to be ported)
StatusFileSize
new579 bytes

Here it is the patch.

Please, take in consideration for next release.

Thanks a lot for the great module,
m.

David Goode’s picture

Hey, thanks for the patch, sorry for the delay but I'll test and probably commit this shortly in some form or another.

David

David Goode’s picture

Status: Patch (to be ported) » Fixed

Committed; seems more standard to do it this way anyway. Thanks.

David

Status: Fixed » Closed (fixed)

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