1 min read

By invitation only

By invitation only

Whether it's for fun, tinkering around or for an actual purpose I like to keep up to date with contrib modules. It gives me the experience to say:

There's a module for that!

And actually know the module and functionality. It's even cooler when you can say you're a co-maintainer of the module you're recommending; and say it with pride!

My latest experimentation was with the Invite module. The purpose of the module is to allow a site to organically grow by a system of invitations. Existing users of the site are allowed to invite their friends thus creating a sort of viral growth similar to the way gmail and facebook used to work.

After installing and having a look around I came across what I thought was a bit of an obvious limitation of the module; invitations are only granted to roles rather than individual users. This is fine if you want to allow an administrative role to have unlimited invites, or if the desire is to just give all users x invites full stop.

However, it seemed to me to be more a limitation than a useful feature. In good Drupal style I decided to write a patch. Bearing in mind the issue I attached it to is over five years old it seems either nobody else wanted the feature or nobody put aside the time to write it.

It didn't take too long to write and seems to do the trick. If the 'per-user' mode is selected in invite configuration, users may have invites granted and rescinded on an individual, per-user basis.

It may not be for everyone and it doesn't look like the patch is getting committed any time soon but sometimes I just can't help but make things better! If you're keen on seeing this functionality built into the invite module post your thoughts on that issue. If you have similar Drupal stories of module improvement or want to comment on this post do so here.