Hi there,

Upon a user is created I need to invoke a call to the following PHP function (is part of a custom module of mine):

lsusers_create($uid);

I have created a triggered rule on event "User account has been created" with the action "Execute custom PHP code". I have tried different PHP codes, but none work:

(1)
Code: lsusers_create($account->uid);
Code: lsusers_create([account:uid]);
Result: I cannot create a user. Every time a new user is created I get the error message "Username already exist" (but the lsusers_create is executed properly).

(2)
Code: lsusers_create($user->uid);
Result: no errors but lsusers_create(0); is invoked and I need to pass the real uid to the function to work properly

NOTES.-

- I have been able to create a "Log to watchdog" action which works properly with the content: "The user [account:user] (uid: [account:uid]) has been created"

This seems to me like a BUG but it could be something I am doing wrong. Sorry I am stuck here have not found any solution to the issue.

Thank you so much,
Unai Rodriguez

Comments

unai’s picture

Version: 6.x-1.x-dev » 6.x-1.3
Component: Rules Core » Rules Engine
Category: bug » support

I came to the conclusion that this is not a BUG on the module so I have updated the issue accordingly.

I have been able to send $account->uid and [account:uid] to other system calls, but not my function.

I am trying to find out where the incompatibility is since I am currently calling lsusers_create from other parts of the system with no issues.

TR’s picture

Component: Rules Engine » Rules Core
Issue summary: View changes
Status: Active » Closed (outdated)

If you still have a problem with one of the current versions of Rules (7.x-2.x or 8.x-3.x) feel free to reopen this issue with updated information and steps to reproduce the problem. Because the error seems to be in your custom function, posting that would be important too.