Page 1 of 1

New replacement code not working

PostPosted: July 24th, 2010, 2:24 pm
by martonic
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!

Re: Replacement code not working - urgent - please help

PostPosted: July 24th, 2010, 2:29 pm
by martonic
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.

Re: New replacement code not working

PostPosted: July 28th, 2010, 6:16 am
by Jason Caldwell
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.

Re: New replacement code not working

PostPosted: July 28th, 2010, 6:18 am
by Jason Caldwell
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.

Re: New replacement code not working

PostPosted: July 31st, 2010, 6:26 pm
by martonic
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.

Re: New replacement code not working

PostPosted: August 5th, 2010, 3:37 pm
by Jason Caldwell
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.

Re: New replacement code not working

PostPosted: August 10th, 2010, 12:00 pm
by martonic
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.

Re: New replacement code not working

PostPosted: August 10th, 2010, 5:45 pm
by Jason Caldwell
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.

Re: New replacement code not working

PostPosted: August 10th, 2010, 5:55 pm
by martonic
The free version.

Re: New replacement code not working

PostPosted: August 17th, 2010, 11:46 am
by Jason Caldwell
@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.