Any plans for porting this community essential module to Drupal 7?

Comments

smk-ka’s picture

Title: Please port to Drupal 7 » Port to Drupal 7
Status: Active » Needs work
StatusFileSize
new50.99 KB

Initial port. Currently broken, since Tokens need to be updated for D7 (where's the docs for that?), therefore 'needs work'.

BenK’s picture

Subscribe...

BenK’s picture

I just came across a link to some documentation on how to update Token integration for Drupal 7. So I thought I would post it on this thread, too:

Token API changes for Drupal 7
http://drupal.org/handbook/modules/token/update/6/7

--Ben

BenK’s picture

Also, here's a helpful video tutorial on updating Token for D7 from DrupalCon San Francisco:

http://sf2010.drupal.org/conference/sessions/token-fun-and-profit-drupal-7

BenK’s picture

I did a bit more research and because Token is now included in D7 core (with a lot of documentation in core, too), it's the perfect time to implement support for tokens.

There's really two separate issues here:

A. Allowing tokens from core (and contrib modules that supply tokens) to be used within an Invite.
B. Having Invite add its own tokens to be used by other modules.

Neither looks too difficult to implement, but perhaps we should start with A because it looks especially straightforward.

So I took a look at the token.inc file found in D7 core (includes/token.inc). It looks like the token_replace() function should do the trick. Here's the example it provides at the top of the file:

* Tokens follow the form: [$type:$name], where $type is a general class of
* tokens like 'node', 'user', or 'comment' and $name is the name of a given
* placeholder. For example, [node:title].
*
* In addition to raw text containing placeholders, modules may pass in an array
* of objects to be used when performing the replacement. The objects should be
* keyed by the token type they correspond to. For example:
*
* @code
* // Load a node and a user, then replace tokens in the text.
* $text = 'On [date:short], [user:name] read [node:title].';
* $node = node_load(1);
* $user = user_load(1);
*
* // [date:...] tokens use the current date automatically.
* $data = array('node' => $node, 'user' => $user);
* return token_replace($text, $data);
* @endcode

Note that D7 core doesn't provide a method to list available tokens for users. However, I found this documentation page (http://drupal.org/handbook/modules/token/update/6/7) that shows how to list available tokens using the D7 version of the Token contrib module (which fills in a few minor gaps in the core implementation):

<?php
// You can call the theme function directly:
theme('token_tree', array('token_types' => array('node')));
// Or use it in a form:
$form['tokens'] = array(
  '#theme' => 'token_tree'
  '#token_types' => array('node'),
);
?>

The cool thing about the above code is that it displays a brand new "token browser" that is much nicer to look at than in D6.

So sma-ka, what do you think?

Cheers,
Ben

BenK’s picture

@smk-ka: I tried to apply your patch in #1, but I wasn't able to apply it against HEAD. Can you re-roll against the current HEAD? I'd like to start active reviewing and reporting back bugs I find.

When I tried to apply the patch, here are the errors I got:

patching file invite.info
patching file invite.install
patching file invite.module
Hunk #3 FAILED at 57.
Hunk #4 FAILED at 119.
Hunk #5 succeeded at 145 (offset 1 line).
Hunk #6 succeeded at 236 (offset 1 line).
Hunk #7 succeeded at 322 (offset 5 lines).
Hunk #8 succeeded at 348 (offset 5 lines).
Hunk #9 succeeded at 404 (offset 5 lines).
Hunk #10 succeeded at 421 (offset 5 lines).
Hunk #11 succeeded at 458 (offset 5 lines).
Hunk #12 succeeded at 468 (offset 5 lines).
Hunk #13 succeeded at 525 (offset 5 lines).
Hunk #14 succeeded at 570 (offset 5 lines).
Hunk #15 succeeded at 587 (offset 5 lines).
Hunk #16 succeeded at 600 (offset 5 lines).
Hunk #17 succeeded at 644 (offset 5 lines).
Hunk #18 succeeded at 658 (offset 5 lines).
Hunk #19 succeeded at 711 (offset 5 lines).
Hunk #20 succeeded at 733 (offset 5 lines).
Hunk #21 succeeded at 790 (offset 5 lines).
Hunk #22 succeeded at 835 (offset 5 lines).
Hunk #23 succeeded at 939 (offset 4 lines).
Hunk #24 succeeded at 969 (offset 4 lines).
Hunk #25 succeeded at 983 (offset 4 lines).
Hunk #26 succeeded at 1096 (offset 4 lines).
Hunk #27 succeeded at 1190 (offset 4 lines).
Hunk #28 succeeded at 1230 (offset 4 lines).
Hunk #29 FAILED at 1267.
Hunk #30 FAILED at 1283.
Hunk #31 succeeded at 1308 (offset -2 lines).
Hunk #32 succeeded at 1328 (offset -2 lines).
Hunk #33 succeeded at 1377 (offset -2 lines).
Hunk #34 succeeded at 1402 (offset -2 lines).
4 out of 34 hunks FAILED -- saving rejects to file invite.module.rej
patching file invite_admin.inc
Hunk #1 succeeded at 67 (offset 10 lines).
Hunk #2 FAILED at 99.
Hunk #3 succeeded at 121 (offset 9 lines).
Hunk #4 succeeded at 193 (offset 13 lines).
Hunk #5 succeeded at 220 (offset 13 lines).
Hunk #6 succeeded at 268 (offset 13 lines).
Hunk #7 succeeded at 294 (offset 13 lines).
Hunk #8 succeeded at 302 (offset 13 lines).
Hunk #9 succeeded at 351 (offset 13 lines).
Hunk #10 succeeded at 368 (offset 13 lines).
Hunk #11 succeeded at 378 (offset 13 lines).
Hunk #12 succeeded at 390 (offset 13 lines).
Hunk #13 succeeded at 401 (offset 13 lines).
Hunk #14 succeeded at 415 (offset 13 lines).
1 out of 14 hunks FAILED -- saving rejects to file invite_admin.inc.rej
patching file invite_cancel_account.info
patching file invite_cancel_account.module
patching file invite_stats.info
patching file invite_stats.module
patching file invite_token.inc

Thanks,
Ben

will_in_wi’s picture

Subscribe

Geeky Lass’s picture

subscribing

jeffl8n’s picture

subscribing

hadsie’s picture

Not sure what the current status is, but it seems like it hasn't changed since the initial patch from @smk-ka. I need this for D7 so I'm currently updating the patch to work with the latest code from HEAD. Hopefully I'll post the updated patch later tonight or tomorrow.

dgastudio’s picture

sub

hadsie’s picture

StatusFileSize
new68.71 KB

Ok, here's an initial patch for D7. I've rewritten the token code but for some reason it still isn't picking it up, so I must have made a mistake somewhere. (i think invite_token.inc needed to be renamed to invite.token.inc). There's a few minor areas where I didn't port the code yet, but just left a @TODO for those areas.

Also, a number of the queries still need to be ported over to the new db_update/db_insert/db_delete style of query.

This is more or less working for me now, so it may be worthwhile to create a D7 branch for it to continue work and bug fixes.

kinshuksunil’s picture

subscribing

chriz001’s picture

subscribing

ccheu’s picture

subscribing

mehtatejas’s picture

can you please provide drupal 7 version of invite module.

kissinger’s picture

When we can download the version for D7?

idiotprayer’s picture

subscribe

sw3b’s picture

subscribe

gvc’s picture

subscribing

smk-ka’s picture

Status: Needs work » Fixed

Nice work, @hadsie! DRUPAL-7--2 has been created and #12 has been committed. For the token include file to be automatically picked up it needed to be renamed to invite.tokens.inc. invite_admin.inc has been renamed accordingly and the additional modules have been moved into its own subdirectory. Therefore, remember to wipe the module directory first, if you had a previous version installed or when upgrading from D6, and remember to run update.php or flush caches. There's still something broken, especially concerning tokens (can't visit the settings page), but let's fix those in separate issues.

mehtatejas’s picture

@smk-ka where can we find DRUPAL-7--2 ?

hadsie’s picture

awesome! thanks @smk-ka. will start dropping new issues in new tickets :)

ccheu’s picture

Mehtatejas,
You can find it here:
http://drupal.org/node/1052170

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nevergone’s picture

Hello, i'm new co-maintainer.
My Drupal 7 Plans:

- Full rewrite: Better API, maybe pluggable system
- Entity-based module: Field attached to Invite
- Full Views backend

lesleyfernandes’s picture

Subscribing

off’s picture

cool, nevergone

jeffwidman’s picture

Would LOVE to see some of the Launchrock.com functionality in either this module or a sub-module.

Their widget basically is a referral engine where you signup, and the 2nd page says "thx. we're giving more bonuses (or earlier access to private beta) if you invite more friends. Here's your referral link (think affiliate code appended to URL). You can also tweet/Facebook this link."

they auto-generate the twitter/facebook link buttons and wrap them back with the custom parameters so the referals are tied back to the individual users.

Right now, I don't see any clean way to pull this off with Drupal 7, so we just used the Launchrock widget on our homepage, but I'd rather use Drupal modules so I can keep better track of the users down the road.

(see it in action: http://pagelever.com/)

hendrakieran’s picture

+1

nevergone’s picture

yugongtian’s picture

+1

starsinmypockets’s picture

Is there any functional development code available for this module? Or could somebody outline the upgrade path? I would possibly be interested in helping to work on this.

hypertext200’s picture

Status: Closed (fixed) » Active
likewhoa’s picture

Title: Port to Drupal 7 » Port invite to Drupal 7

Subscribe...

whyn0t’s picture

Subscribe...

Håvard’s picture

Subscribing

theullrich’s picture

sub

Carlos Miranda Levy’s picture

subscribe

rogical’s picture

+1

Hazeltree’s picture

subscribe

Fidelix’s picture

Subscribing...

kolobok38’s picture

+1

halloffame’s picture

Subscribing...

sslider999’s picture

sub

hgroover’s picture

Title: Port invite to Drupal 7 » patches for 7.2
Version: master » 7.x-2.x-dev
StatusFileSize
new643 bytes
new922 bytes

Thanks to those who have put so much work into this module. I'm new to contributing and still getting into module development, but found a couple of issues running the 7.2 version with Drupal 7.2. Patches are attached:

1. The default email template doesn't have the right substitution tag
2. The processing of the invite does not have the right function reference.

I'm still looking into why you can't have admin-only registration - from looking at the module sources it should work, but I get "Access denied" when trying to use a registration invite unless registration is open or set to admin approval.

A probably-unrelated problem is that although I'm using user_relationships_invite to specify relationships at invite time, they are not applied. I think it's in the user_relationships_invite sub-module...

-Henry

likewhoa’s picture

Title: patches for 7.2 » Port invite to Drupal 7
Status: Active » Needs review

@hgroover best to leave title as is so it's easier to find for others, also you just need to set status to 'needs review' then the community and or a maintainer can look at your patch for review and ultimately inclusion into the project. Thanks for patch!

Taxoman’s picture

Subscribing

hgroover’s picture

@likewhoa Thanks for the feedback, I'll make sure to do that next time. I wasn't able to edit those parts of my comment but if I end up with a better resolution to problems I'm still investigating I can re-post with updated patches.

Previously I've done all my Drupal site mods via php content hackage, just starting with Drupal 7 and now trying to do everything properly via modules...

milorand’s picture

subscribing

dddbbb’s picture

Any chance we can get this up as a dev version on D.O?

Andy B’s picture

Status: Needs review » Active

I am getting the following errors when enabling the module in D7.x-dev:

• Deprecated function: Call-time pass-by-reference has been deprecated in drupal_load() (line 911 of C:\inetpub\sites\Drupal\includes\bootstrap.inc).
• Deprecated function: Call-time pass-by-reference has been deprecated in drupal_load() (line 911 of C:\inetpub\sites\Drupal\includes\bootstrap.inc).

Sometimes I get 2 of these and sometimes I get 4 of them. The modules page is where I always get 4.

medden’s picture

Category: task » bug

subscribing

likewhoa’s picture

Category: bug » task

@medden this is a 'port issue' not a bug report issue, therefore it should be set as task.

likewhoa’s picture

Title: Port invite to Drupal 7 » Port invite module to Drupal 7

just updating title for better tracking.

medden’s picture

Sorry I did initially add a bug report, but then found it was a duplicate, so I just edited my post.
Forgot to change the category sorry.

gillarf’s picture

subscribe

jamiegotluckies’s picture

I am literally waiting on the 7.x release of this module to launch my website! Subscribing x1,000,000!

pancrilio’s picture

subscribe

crispinbailey’s picture

+1

davycw’s picture

+1

orendain’s picture

subbing

funkju’s picture

+1

medden’s picture

Is there anything we can do to help get a working version released?

andrenoronha’s picture

+1

jg352’s picture

subscribe

mefisto75’s picture

sub

frank.schram’s picture

subscribe

frank.schram’s picture

After sending an invitation, the following error pops up:

Warning: unserialize() expects parameter 1 to be string, array given in invite_get_remaining_invites() (line 702 of .../sites/all/modules/invite/invite.module).
Notice: Undefined index: rtid in user_relationship_invites_invite_form_validate() (line 52 of .../sites/all/modules/user_relationships/user_relationship_invites/user_relationship_invites.module).
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'rtid' cannot be null: INSERT INTO {user_relationship_invites} (inviter_uid, rtid, invite_code) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => 23 [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => x4ZfrZBy ) in user_relationship_invites_invite() (line 67 of .../sites/all/modules/user_relationships/user_relationship_invites/user_relationship_invites.module).

The invitation is sent succesfully, but after the invited user registers, he gets the following:

Fatal error: Call to undefined function invite_process() in .../sites/all/modules/invite/invite.module on line 481

Is this known??

william.lai’s picture

StatusFileSize
new517 bytes
new1.44 KB

Hi, i have two issue in invite.admin.inc and invite.module.
- cannot withdraw the invitation in user profile page
- cannot list details of invitation in admin page

Here are the patchs for it and please review.

Thanks,

william.lai’s picture

oh, updated the invite.module.patch with following code, otherwise, user with invitation code cannot process the registration in my case.
please review.

-    $roles = invite_process($invite, $account);
+    $roles = invite_process_invite($invite, $account);
hubScrappy’s picture

Re: Comment #70

Just so that you don't think you are the only one afflicted, I get this one as well .. so it isn't somethign specific to your install ...

But ... if you disabled the User RElationships - Invite module, the error goes away ...

Refineo’s picture

subscribe

ehmprah’s picture

+1

frank.schram’s picture

Re: Comment #72

thank you, this works now

dgastudio’s picture

last commits:
2 months ago 7.x-4.x
4 months ago 7.x-2.x

is this module still in development by mantainers?

rogical’s picture

hope some one can take over the 7.x-4.x development.

as invite is really important in social network building.

dannyjohnson1’s picture

I would be willing to discuss a small amount of sponsorship - say $200 or £120 - for a fully tested release of a Drupal 7 version of Invite... if current or potential maintainers would like to get in touch. daniel [at] ashworthmarketing.co.uk

chris_boudreaux’s picture

I'll add another $100: chris [at] socialmediagovernance.com

mototribe’s picture

subscribe

paul_constantine’s picture

subscribe

hubScrappy’s picture

Right now, I don't much care about a 7.x-4.x version ... the concept is nice and all, but there is a mostly working 7.x-2.x version that is out there ... what would be nice is while the maintainers are playing with the 4.x version, they were to apply the various patches (I just posted a new one) that have been submitted for the 7.x-2.x branch, and package up a new 7.x-2.x-dev release, just so that those needing invite had a working version now ...

Real OSS developers don't get paid to develop, so it is understandable that the 7.x-4.x re-write is taking awhile while you keep a roof over your head and feed your children, but roll in patches that are submited for the older version ...

jg352’s picture

where is 7.2 version?

dgastudio’s picture

jg352’s picture

thx kervi

jenlampton’s picture

subscribe

scripthead’s picture

subscribing

nagiek’s picture

.

josephpnc’s picture

Category: task » support

Hi guys. It's so cool to know you guys are working to move this to Drupal 7. I got one issue though. After installing on Drupal 7.6, I can't find the option for: "New user registration by invitation only" under Configuration > Account Settings. Can somebody help? THANKS!

Btw, I downloaded it from here: http://drupal.org/node/20967/release?api_version[]=103 (version downloaded is invite 7.x-2.x-dev

Taxoman’s picture

Category: support » task

@josephpnc: please dont hijack this issue, open a new one for your support request. (by clicking on "create new issue" at the top of the issue queue page: http://drupal.org/project/issues/invite )

josephpnc’s picture

oh so sorry. will do.

sw3b’s picture

Is it possible to update the DEV with latest patch if possible... there is like a lot of thread with different patchs and DEV version is from april...

thanks !

mgifford’s picture

Agreed with @sw3b. Would be great to have a dev release.

glekli’s picture

I put the dev release on the project page so that it is more apparent that there is some progress going on in the 7.x branch.
The dev was recently updated with the patches that were in the issue queue and other refinements.

mgifford’s picture

Thanks!

sw3b’s picture

thanks !

nagiek’s picture

Thanks!

What's the -dev status? I'm sure it's not production ready, but beta-level? alpha-level? ..unstable? :)

glekli’s picture

I'd say it's a good alpha. Any bug reports are encouraged and welcome.

Taxoman’s picture

Status: Active » Fixed

Great! :-)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

junkerjp’s picture

"Re: Comment #70

Just so that you don't think you are the only one afflicted, I get this one as well .. so it isn't somethign specific to your install ...

But ... if you disabled the User RElationships - Invite module, the error goes away ..."

I was having the same issue. However, once a relationship type is actually created, that error will disappear.

glekli’s picture

junkerjp,

That issue is related to UR module's Invite integration. See here http://drupal.org/node/1345694. The patch posted there will likely solve it. Please open a new issue if anything comes up.