Depending of the success and the feedback of the module, the porting to Drupal 7 has to be taken into consideration. Two main parts must be considered here:
- check the invitation process of the new organic groups module on Drupal 7, because the module is quite different than the Drupal 6 module
- make the required changes (implement the code changes, use the Drupal 7 or OG new features when possible, testing, etc...).

Comments

yugongtian’s picture

+1

romany’s picture

+1

jaxpax’s picture

+1

stefan vaduva’s picture

It seems that the invite functionality has been discontinued from OG core: http://drupal.org/node/1186962

I'll try to take a look at this module and see if I can help with the migration for D7.

stefan vaduva’s picture

By looking at this module and at the way the new groups work, I'm thinking that a rewrite will be more useful than a port. The main reason why I'm saying this is because in the new version of OG everything can be a group while this module only handles groups as nodes.

Vasi1186, Mikestefff what do you think?

mstef’s picture

Yea, I was going to state that the nature of OG in D7 has changed so drastically [part assumption] that a port doesn't make sense. I think OG and any invitation functionality present in D7 must first be studied to decide what, if anything, is needed.

Fidelix’s picture

Subscribing...

rv0’s picture

subscribe

james.williams’s picture

subscribe. I may get chance to work on invitation functionality in D7 very soon for a project we are currently working on. Is it worth setting up a sandbox?

rv0’s picture

@james.williams
also in the same position.. currently checking http://drupal.org/sandbox/stefanvaduva/1187048 for a D7 port of OG Invite

vasi1186’s picture

Hi,

If anyone wants to contribute for a drupal 7 porting, is welcome. If you clone the project, there should be a new branch for d7. So, if you would like to contribute, just tell me and we can see if I can add you as a module maintainer.

james.williams’s picture

I realise this might seem a bit like a fork - sorry for that, it's because we started to work on this before rv0 had posted about that other sandbox above, and because the full version of this has other site-specific additions - but see http://drupal.org/sandbox/jameswilliams/1228942 for a working D7 port, which also adds functionality to invite non-members (like was requested in http://drupal.org/node/1097578)

james.williams’s picture

...I won't have time for a while to work at turning that work into something more useful like a patch for OG Invite Link, but it's on my long-term to-do list. If anyone wants to take a look and make any suggestions etc, please do.

medden’s picture

subscribe

rafhuys’s picture

StatusFileSize
new1.51 KB

Thanks james,

totally fits my needs. there was however a change in the og_group() method of og, so you need to change line 327 of og_invite_link.pages.inc.

james.williams’s picture

Thanks rafhuys - I've committed most of those changes to my sandbox. I'm not sure what the following bit is about though?:

elseif (!empty($user->uid) && empty($user->mail) || ($user->uid != $invitation->uid && $user->mail != $invitation->uid)) {
-    return _og_invite_link_invalid_invitation();
+    //user may be anonymous for now
+    if ($user->uid != 0){
+      return _og_invite_link_invalid_invitation();
+    }

...So I've left this out for now.

james.williams’s picture

Meanwhile, here's a a fairly hefty patch for anyone preferring to use a patch rather than the sandbox.

Sylense’s picture

+1

steffenr’s picture

@james.williams - i just applied "patch" #16 to your sandbox's version - now the inivitation is working fine. Your sandbox's version just throws an error, that the invitation codes are incorrect..

Thx

jhrizz’s picture

Not to sound lazy, but would anyone be willing to post or email their final working product?

Also, if this is gaining legitimacy (as I think it is essential, not matter how it is done) should it be versioned to a true blue 7.x -dev?

Two questions, first one is more interesting (to me).

Cheers!

- Josh

james.williams’s picture

StatusFileSize
new56.42 KB

Rafhuys was right all along about that chunk of code in comment #16... the configuration on my system meant a quirk of PHP stopped me seeing the issue. I've committed a fix to my sandbox, and an updated patch is attached.

@jhrizz you can find my sandbox at http://drupal.org/sandbox/jameswilliams/1228942 -- you have to check it out of Git, see the Version control tab for full directions. Otherwise, patch the original OG Invite Link with the attached patch.

james.williams’s picture

Status: Active » Needs review

I think it's fair to say now that this is at the 'needs review' stage?

jhrizz’s picture

@ james.williams

Will do! Thank you!

ohthehugemanatee’s picture

@james.williams thank you for your great work on the sandbox. Jeez the module directory name is long :)

I tested this today against my D7-latest, here were the issues I found:

* Invitations seem to break on some symbols. For example, I use the + sign for development email accounts, ie ohthehugemanatee+test1@gmail.com . According to the email RFC, those messages get delivered to ohthehugemanatee@gmail.com . But any invitations created for that address failed validation and returned "not a valid invitation". Other invites were fine. Maybe it would be better to use the invite ID in the invite link instead of the email address, since that way we don't have to deal with symbols?

* The invitations worked, but never added my user to the group.

I would suggest a different approach... something like how LoginToboggan works with users... When an invite is generated for a non-user, actually create the user account with status blocked, or optionally active with an admin-specified role, and use Drupal's password reset function to generate the login link. Saves a lot of trouble. You can still use similar code for expiry, just check to see if the account has ever been used to login, and delete it if it hasn't. Since the account is actually created with the invite, you can actually add the user to the group right away. This would allow the group admin to go ahead and assign special group roles or whatever to that user, rather than having to wait for him to login.

I know what I'm suggesting is a substantial rewrite, but I think it's also much easier in a lot of ways. I'll try and poke at it this way and send my results back.

ohthehugemanatee’s picture

Before anyone goes off on goose chases: the reason it wasn't adding my user to the group, is that I had a Rules redirect upon login that overrode the destination parameter in the URL. Another reason to actually create the account first. :)

james.williams’s picture

@ohthehugemanatee I like your idea of creating user accounts and using the password reset functionality. Would you like commit access to my sandbox if you plan on doing some work on it? I'm very unlikely to do any further work on this myself for a good while.

medden’s picture

I get a problem with this line of code...

if ((is_object($account) && !$account->uid) || (is_string($account) && !valid_email_address($account)) ||     (!is_object($account) && !is_string($account))) {

If I try to invite more than one person by email address, the !valid_email_address($account) fails for all except the last address....
anyone know why?

medden’s picture

Fixed it, there was a carriage return within the $account string, which stopped it validating as an email..
Put this before the if statement to fix the issue.... (line 281 of og_invite_link.module).

 $account = str_replace("\r", '', $account);
ohthehugemanatee’s picture

Hey james.williams ... sadly I don't think I'll have time, but I really like how transparently this module is coded so I'm sure I'll be working with it again in future. I found your code really clear and easy to work with!

One other idea too... it would be very cool to rewrite this in with Rules and Entity. Invitations are an Entity, which gets related to the OG target, maybe the OG membership type, the account of the invitor, and the (initially blocked) account of the invitee. Provide a trigger for when an invitation is created, and one for when it's redeemed. Then distribute a pair of Rules with the module, one that creates and blocks the account on invite creation, and one that unblocks and logs the user in when the invite is redeemed. That greatly cuts down the amount of code you need in the module. Just define the entity, define two triggers, and bundle the Rule in with it. Added bonus: no custom db table to maintain, so update paths should be easier.

Of course it's way easier for me to SAY this without actually contributing anything... sigh. Feel free to ping me in the summer, I might have some spare time to play with this in August and it would be fun to do a ground up Entity approach like this.

ezra-g’s picture

Issue tags: +commonslove

Adding the commonslove tag.

zdean’s picture

Re: #22, it looks like this does not work with OG 7.x 2.x dev

mohit_aghera’s picture

I am using Og 7.x-1.5
After installing that module from sandbox http://drupal.org/sandbox/jameswilliams/1228942 it gives me the error

Fatal error: Call to undefined function node() in D:\wamp\www\myproject\includes\form.inc on line 1460

alesr’s picture

What's the latest "news" about OG Invite members functionality for OG 7.x-2.x?
This feature is really missing and no dev branch didn't came close to a stable solution.

It's +1 for me to help developing it. I created an "OG Invite new" module based on Invite API http://drupal.org/project/invite
We should all join the powers and create THE solution for inviting members to og groups for OG 7.x-2.x
I'm on IRC #drupal-og

vasi1186’s picture

Hi alesr,

thx for your support! I am currently too much busy to continue with the development of this module, so if there is anyone that can take over the further development, that's perfect. There is a branch for d7 migration of this module: http://drupal.org/node/1082946/git-instructions/7.x-1.x but I am not sure how is the status of it. So, if you have time, fell free to check it and continue the development.
I am also on IRC, on #drupal, #drupal-i18n and #drupal-contribute

Vasi.

alesr’s picture

Here is a Drupal 7 version for OG Invite People.

Works with OG 7.x-2.x and doesn't need Invite module.
I needed a user created and invited to group when emailing him so I didn't used the Invite module.

4alldigital’s picture

Issue summary: View changes

I have downloaded the http://drupal.org/node/1082946/git-instructions/7.x-1.x version, and got a version finished, at least for my own purposes of inviting users to group via email (which creates a user account for them), but also added an "offline invite URL" to invite friends on Facebook or print a PDF with the invite URL on it to be shared and/or posted for an events site I have done.

I have not contributed or maintained any modules on Drupal.org before, but I friend says I should mention this to see if there's any interest in getting this up and running as a D7 module. advice on what to do next would help...