I'm currently working on integrating the Invite module with the Membership types and registration modification module, allowing invited users to be restricted to certain membership types. It's easy enough to do-- but it does require a slight update to the Invite API.
My module works by using hook_form_alter() to alter the invite_form and place in some new form elements. However, these elements are subsequently NOT accessible to my module for processing, unless I either:
(a) scrap the idea of writing a separate module and just edit the Invite module directly [not a good idea because it's a LOT of code for integrating with a module that not everyone will need or use]
OR
(b) have the form passed on to my module when my module calls hook_invite().
Obviously, the second option is a lot cleaner for all parties involved.
It's actually such a minor change that it's not necessary to put it in a patch. Literally, all it takes is adding in
'edit' => $edit
to the $args array just before the line:
module_invoke_all('invite', 'invite', $args);
I hope I've made a good case for why this slight change to the API would be helpful!
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | invite-add_form_state-367861-3.patch | 998 bytes | bdlangton |
| #2 | add_form_state_invite.patch | 563 bytes | christianchristensen |
| #1 | add_form_state_invite.patch | 563 bytes | christianchristensen |
Comments
Comment #1
christianchristensen commentedHaving come across a similar situation where I required hook_form_alter elements on a the submit handlers hook_invite I think this could be accomplished by adding the $form_state to the args passed to the hook (see patch).
Comment #2
christianchristensen commentedJust to be clear that patch was for the current CVS HEAD on 6.x (the version looked wrong in the posting - patch re-attached...)
Comment #3
bdlangton commentedUpdated patch #2 so that it applies cleanly.
Comment #4
avpadernoI am closing this issue, since it's for a Drupal version no longer supported.