I get a "Sorry, you've reached the maximum number of invitations." error which is not the case.

I investigated and saw that it's an old error. the last release is on April and this error is still not fixed.

is someone working on this module ?

CommentFileSizeAuthor
#10 invite-role.patch527 bytesdawehner

Comments

shenagarg’s picture

There might be some problem with settings of invite module.

You can go to page /admin/user/invite/settings and there in role settings you can check the limit invitation limit and change the variable accordingly.

I hope this solves the problem.

Ivan Simonov’s picture

Priority: Normal » Critical

/admin/user/invite/settings useless in this situation!

Ivan Simonov’s picture

Title: is someone working on this module ? » you've reached the maximum number of invitations...

bug in the invite.module (When 'authenticated user' role is localized)

 function invite_get_role_limit($account) {
  if (!isset($account->roles)) {
    $account = user_load(array('uid' => $account->uid));
  } // here 'authenticated user' role (unlocalized)

  $role_limit = 0;
  foreach (user_roles(0, 'send invitations') as $role) {
    $role_no_space = str_replace(' ', '_', $role); // here 'зарегистрированный пользователь' role (localized)

    if (in_array($role, $account->roles)) {
      $role_max = variable_get('invite_maxnum_'. $role_no_space, INVITE_UNLIMITED);
      if ($role_max == INVITE_UNLIMITED) {
        return INVITE_UNLIMITED;
      }
      $role_limit = max($role_max, $role_limit);
    }
  }
  return $role_limit;
} 

Temporary fix:
GOTO admin/build/translate/search
SET authenticated user=authenticated user (or delete this translation)
THAT`S ALL

TO authors:
1) please fix this bug for international community
2) also add options '1', '2', '3' to $form['role'][$role_no_space]['invite_maxnum_'. $role_no_space]
invites count list like 1,2,3,5,10,20,50,100,∞ looks better than 5,10,20,50,100,500,1000,∞
3) function _invite_escalate_role($account) do not escalate roles

Wish success you to finetune this nice module

drupallogic’s picture

thank you for your effort. I assume some other developer should take this module. Current ones do not care any more.

Doud’s picture

Works perfectly, i'm running a french website and had the same problem.

Your solution works, but is not so 'clean'. I'll try to solve the problem.

ziobudda’s picture

After this line in the "invite_get_role_limit" fuction

$role_limit = 0;

add

  foreach($account->roles as $k => $v) {
    $account->roles[$k] = t($v);
  }

This works for me.

M.

netrom’s picture

Hi Ivan Simonov.

I have no ../translate/search in my buildmenu so how do I find this?

/M

sciem’s picture

Instead of alpha just use dev version. It is fixed now - according to changelog: http://drupalcode.org/viewvc/drupal/contributions/modules/invite/CHANGEL...
It works fine for me with no hacking at all. Module is great! Good job maintainer!

Ivan Simonov’s picture

to netrom
If "Locale" module enabled you can use http://yoursite.com/admin/build/translate/search

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new527 bytes

The fix provided as patch

smk-ka’s picture

Status: Needs review » Fixed

Thanks, this has already been fixed in the development snapshot.

Status: Fixed » Closed (fixed)

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