PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

New replacement code not working

s2Member Plugin. A Membership plugin for WordPress®.

New replacement code not working

Postby martonic » July 24th, 2010, 2:24 pm

Hi Jason,

Using s2member 3.1.5, I composed an URL like this:

http://mysite.com/my-functions/new_user.php?id=%%user_id%%

for the Notification URL in Registration Notifications.

I have the following code in new_user.php.

Code: Select all
$id  = $_GET['id'];
error_log("id = $id\n", 3, 'debug.log');


Here is what got sent to my function, as shown by the debug log:

cat debug.log

id = %%user_id%% :o :o :o :o :o

That's not what I expected to see!
Last edited by martonic on July 24th, 2010, 7:31 pm, edited 2 times in total.
User avatar
martonic
Experienced User
Experienced User
 
Posts: 70
Joined: July 14, 2010

Re: Replacement code not working - urgent - please help

Postby martonic » July 24th, 2010, 2:29 pm

I dumped the GET for %%user_first_name%% and it is correct!

So it's not that I don't know what to do, it's that the new %%user_id%% code does not work!

I need that to work - please fix this ASAP - thank you!


Edit: I will get it from the database by keying on email for now - a work around.

Edit: Locating the user record based on email worked, so progress is still being made.
User avatar
martonic
Experienced User
Experienced User
 
Posts: 70
Joined: July 14, 2010

Re: New replacement code not working

Postby Jason Caldwell » July 28th, 2010, 6:16 am

Hi Martonic. Thanks for reporting this.

I just ran tests on s2Member, and s2Member Pro.
In both cases, I set s2Member -> API Notifications -> Registration Notifications
http://mysite.com/?user_id=%%user_id%%
and the value came through OK for me.

Can you please walk me through exactly what I need to do in order to reproduce this please?
~ Thanks in advance.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: New replacement code not working

Postby Jason Caldwell » July 28th, 2010, 6:18 am

Just to note. The %%user_id%% replacement code is ONLY available for "Registration" Notifications. I'm assuming that you're aware of this; but since I was unable to reproduce it, I thought I would throw it out there.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: New replacement code not working

Postby martonic » July 31st, 2010, 6:26 pm

Code: Select all
http://my_site.com/new_wp_user.php?secret=my_secret&id=%%user_id%%&fname=%%user_first_name%%&lname=%%user_last_name%%&login=%%user_login%%&level=%%level%%&email=%%user_email%%

$secret = $_GET['secret'];
$wp_id  = $_GET['id'];

debug("new-wp-user--- wp_id = $wp_id, email = $email");

[bern]$ cat debug.log

new-wp-user--- wp_id = %%user_id%%, email = test7@bulldogdiversions.com


Mysterious!

Edit: I tried moving the "secret" (only letters and numbers in there) to the end of the URL - but the result was the same. When the notification is received, all the fields are correct except for user_id, which is set to the "replacement code" instead of its expected value.
User avatar
martonic
Experienced User
Experienced User
 
Posts: 70
Joined: July 14, 2010

Re: New replacement code not working

Postby Jason Caldwell » August 5th, 2010, 3:37 pm

Thanks for reporting back on this.
OK. So can you please explain how the original transaction was processed exactly? Was this a transaction completed with an s2Member Pro Form, or through a PayPal Button? Or perhaps just a free registration?

@PR TODO :: possible bug existing with %%user_id%% replacement code.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: New replacement code not working

Postby martonic » August 10th, 2010, 12:00 pm

Hi Jason,

This was a free registration, as we are not allowing payments until someone already has a WordPress account.

Thanks again for looking into this.
User avatar
martonic
Experienced User
Experienced User
 
Posts: 70
Joined: July 14, 2010

Re: New replacement code not working

Postby Jason Caldwell » August 10th, 2010, 5:45 pm

Thanks for reporting back on this.
martonic wrote:Hi Jason,

This was a free registration, as we are not allowing payments until someone already has a WordPress account.

Thanks again for looking into this.

Still unable to reproduce this. Was this with the free version of s2Member, or with s2Member Pro? In other words, was this free registration processed by an s2Member Pro Form, or by the wp-login.php?action=register file?

Thanks again.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: New replacement code not working

Postby martonic » August 10th, 2010, 5:55 pm

The free version.
User avatar
martonic
Experienced User
Experienced User
 
Posts: 70
Joined: July 14, 2010

Re: New replacement code not working

Postby Jason Caldwell » August 17th, 2010, 11:46 am

@POSSIBLE RESOLUTION :: possible bug existing with %%user_id%% replacement code.

Please let me know if this problem still exists in s2Member v3.2+.

- Replacement Codes. The `%%user_id%%` Replacement Code has been added to several other API Notifications now. Also, there are two new Replacement Codes for Payment Notifications ( `%%subscr_payment%%`, `%%subscr_payment_user_id%%` ). For further details, see: `s2Member -> API Notifications` in your Dashboard.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA


Return to s2Member Plugin

Who is online

Users browsing this forum: Exabot [Bot] and 0 guests

cron