The "registered user" role always have a "Sorry, you've reached the maximum number of invitations" message when attempting to send invitation. (Even with "unlimited" number option enabled for this role). What is this?
| Comment | File | Size | Author |
|---|---|---|---|
| #29 | invite_role-ids.patch | 6.21 KB | andypost |
| #26 | invite_role_0.patch | 4.98 KB | andypost |
| #25 | 322748-invite.role_limit.patch | 688 bytes | ckng |
| #18 | invite.role_limit.patch | 608 bytes | setvik |
| #12 | invite.module.322748.diff | 747 bytes | tpohlsch |
Comments
Comment #1
Thoor commentedSubscribe ... because I have exactly the same Problem
Comment #2
gatonero commentedMe too. Even deactivating, uninstalling and reanstalling doesn't solve it.
Comment #3
zio commentedI don't understand: in invite.install there is function for schema update - invite_maxnum_ should be in permissions table. But there are no such entry in permissions. Reinstalling and update.php don't help. What else?
Comment #4
Excaliber commentedsame problem here.. doenst work with normal users
Comment #5
Popolo-1 commentedI got the same issue and found a way around (the issue could be linked to a translation matter).
I have a site in French and therefore the 2 following strings are translated as follow.
- 'anonymous user' --> 'visiteur anonyme'
- 'authenticated user' --> 'visiteur identifié'.
I had to translate these 2 strings back in English over the translation interface:
- 'visiteur anonyme' --> 'anonymous user'
- 'visiteur identifié' --> 'authenticated user'
and this solved the issue.
I am using D6 and module Invite 6.x-2.x-dev
Comment #6
zio commentedvery interesting! How this trick can work? In db schema roles are coded in two different tables and there are no relations to translation.
But.... it's work for me also.
I hope that somebody can find and fix this tiny bug.
Comment #7
gatonero commentedThis workes for me too. Now I'm using this modul again because I like, that's possible to personalize the invitation. Because I didn't use the modul before this workarround and I'm using it now with this provisorium I set priority to critical.
Comment #8
edalcin commentedIs it in English? Works with me if the Default language is "English"..... Which brings another issue, already reported.
Comment #9
lillywolf commentedSo this can also be fixed by creating a new role, giving that role the appropriate invite permissions, and then assigning that role to your users. For some reason, though, just giving authenticated users the right invite permissions isn't working.
Comment #10
ij commentedsame here, subscribing...
Comment #11
tpohlsch commentedThe roles array in the $account object is not (fully) localized (since the default "registered" role is manually added to the array, it's always called "authenticated user"). So simple localization of the roles in $account->roles does the trick.
Disclaimer: While this works well for me on a site with German localization, and IMHO should (tm) work on "real" multi-lingual sites, I have not thoroughly tested this. The bit of code below is exactly what it says it is: a QUICK fix.
Quick fix:
.../modules/invite/invite.module, line 655+
Comment #12
tpohlsch commentedChanges suggested in #11 (so I'm not accused of being lazy, correct as that may be... :) )
Comment #13
geraldito commentedpatch fixed that error for me and users with role "registered user" can send invitations. thanx
Comment #14
guldi commentedthanks mates, fixed it also for me.
now also possible to send invitations as guest.
Comment #15
kalbun commentedGreat! Thank you, I fixed the problem in my site too (Italian/Romanian/English)
-- Kalbun
Comment #16
tpohlsch commentedSure, no problem! :)
Comment #17
Stan.Ezersky commentedThanks a lot for patch! It works for my project: Drupal 6.9 (English, Russian)
Comment #18
setvik commentedBuilding on tpohlsch's patch above, I think we can simplify the code a bit by comparing the role IDs instead of the role names which has the added bonus of avoiding the translation issue altogether.
References:
sess_read() in session.inc
user_roles() in user.module
invite_get_role_limit() in invite.module
Comment #19
sebzur commentedThanks! Now Invite works perfect!
Comment #20
Aleksic commentedThanks! Now Invite works perfect:D
Comment #21
invi commentedGreat patch! It also fixes problem with no showing invite block for logged user.
Comment #22
geek-merlinpatch #11 does the job for me.
@setvik, the direction you go "feels better" for me.
but if i review your patch right, the result uses the $role_no_space variable, without setting it. which gives "unlimited" for all inviters.
Comment #23
jsmm commentedSame problem in Spanish, both for authenticated and anonymous user, not for admin. Will the patch be included in a new version? Thanks,
jmm
Comment #24
pal_ur commentedsubscribe
Comment #25
ckngPatch #18 is incomplete though, as the $role_no_space was not defined, thus giving the default INVITE_UNLIMITED.
Updated the patch.
Comment #26
andypostSuppose better to change variable format to store role_id against role_name which is always translatable for $rid=2.
Marked as duplicate http://drupal.org/node/338005#comment-1849252 - read this comments
Limit is not only one place where this used so here patch with upgrade path and different variable names
Comment #27
andypostPatch from author is the same so rtbc
http://drupal.org/node/443916#comment-1554810
Comment #28
andypostBetter mark this duplicate of #443916: Using role-names instead of ids caused problems with other languages
Comment #29
andypostThis patch more complex so I add upgrade path and mark as duplicate #443916: Using role-names instead of ids caused problems with other languages
Sorry for buzz of my comments...
Comment #30
smk-ka commentedThanks, committed a slightly enhanced version that also takes care of upgraded D5 installations.