I've seen it referenced but cannot figure out how to reference an initial value easily. I've seen examples where a "var1..." and "var3..." were used as initial and new values but unclear on how it was either set or known that these were the values of interest.
I can do it, but I created query fields to hold initial values. I don't think this is necessary, is it?
What I want to do is fire an Auto Action when a user saves a change to a particular field in their profile.
Still have a question, brain just not wrapping... Let me explain what I believe and ask a clarifying question.
One
$_PLUGINS->trigger( 'onBeforeUpdateUser', array( &$user, &$user, &$oldUserComplete ) )
This is triggered in the Back-End
The first $user is var1_, it is also what gets returned as "Automatic" for AutoAction and is object being updated
The second $user is var2_ is user doing update if not updating your own profile
$oldUserComplete is var3_ and it is the original data for the user object being changed
Two
$_PLUGINS->trigger( 'onBeforeUserUpdate', array( &$user, &$user, &$oldUserComplete, &$oldUserComplete ) )
This is triggered from Front-End
Question - Assuming I am correct so far, what is the second $oldUserComplete?
I think I'm close, just missig a little bit here I think...
Use the after profile update trigger and compare var1 to var3. Var 1 being the new user object and Var 3 being the old user object. Example as follows.
[var1_cb_myfield] Not Equal To [var3_cb_myfield]
The above would check if the cb_myfield field value has changed.
Kyle (Krileon) Community Builder Team Member Before posting on forums:
Read FAQ thoroughly
+
Read our Documentation
+
Search the forums CB links:
Documentation
-
Localization
-
CB Quickstart
-
CB Paid Subscriptions
-
Add-Ons
-
Forge
-- If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
-- If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please
send me a private message
with your thread and will reply when possible!
-- Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
-- My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.