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!

Comments

christianchristensen’s picture

Version: 5.x-2.x-dev » master
StatusFileSize
new563 bytes

Having 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).

christianchristensen’s picture

Version: master » 6.x-2.x-dev
StatusFileSize
new563 bytes

Just to be clear that patch was for the current CVS HEAD on 6.x (the version looked wrong in the posting - patch re-attached...)

bdlangton’s picture

StatusFileSize
new998 bytes

Updated patch #2 so that it applies cleanly.

avpaderno’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

I am closing this issue, since it's for a Drupal version no longer supported.