Active
Project:
Invite
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
29 May 2012 at 07:36 UTC
Updated:
23 Jul 2012 at 06:26 UTC
Jump to comment: Most recent file
The attached patch adds the possiblity (if permitted) to assign additional roles to individual invites. I reused code from the cancelled Registration Role Keys module (http://drupal.org/project/rolekey) to achieve this.
This feature required a new link table "invite_roles", and the patch does not contain update scripts, so you have to uninstall and install again to get the patch to work.
I hope someone else than me will find this useful.
This issue is related to:
#1423590: Adding possible roles to the invite UI
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | add_invite_roles_v3.patch | 3.1 KB | ttiurani |
| #1 | add_invite_roles_v2.patch | 5.4 KB | ttiurani |
| add_invite_roles.patch | 4.08 KB | ttiurani |
Comments
Comment #1
ttiurani commentedAttached is v2 of the patch with a (trivial) to change query variable reference from ':iid' to 'iid'.
Comment #2
ttiurani commentedForget the previous comment and v2 of the patch, it seems that ':iid" is the standard and 'iid' the exception. Attached is v3 of the patch which uses ':[key]' everywhere.
Comment #3
lennyk commentedthank you so much! you're a lifesaver.
edit:
after some testing, I'm getting this error upon sending an invite
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mydatabase.invite_roles' doesn't exist: DELETE FROM {invite_roles} WHERE iid = :iid; Array ( [:iid] => 3 ) in invite_form_submit() (line 1307 of /home/gak/public_html/sites/all/modules/invite/invite.module).and this error when a new user tries to register (it fails):
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mydatabase.invite_roles' doesn't exist: SELECT DISTINCT r.rid FROM {invite_roles} ir INNER JOIN {role} r ON (ir.rid = r.rid) INNER JOIN {invite} i ON (ir.iid = i.iid) WHERE i.iid = :iid; Array ( [:iid] => 2 ) in invite_target_roles() (line 777 of /home/gak/public_html/sites/all/modules/invite/invite.module).Comment #4
lennyk commentedFor anyone else looking to use this patch, I had to create the invite_roles table manually. This worked for me:
Comment #5
ttiurani commentedYeah, as I said, there is no upgrade script that would create the table when it is just applied to an installed Invite module. But the table should appear if you apply the patch, disable the module, uninstall the module and enable it again. No?
Comment #5.0
ttiurani commentedFixed typos