Long ago I wrote a plugin that used the following interface for the onBeforeUserUpdate trigger:
Code:
function beforeUserUpdate(&$user, &$cbUser)
Based on my decade-old code, I handled these two inputs as user being what was already stored in the database and cbUser being what was about to be stored. Debugging that plugin now, it appears these two objects may be identical when a profile change is impending. At least the fields my plugin is checking are identical. So I looked at the current (might be dated by now) trigger interface for this event on your "Using CB Triggers" page and now it looks like this:
It's not a documentation glitch. Those variables used to be something else a long time ago in CB 1.x (probably 6+ years ago). To prevent errors they were replaced with duplicates of existing objects. It's basically just backwards compatibility. With CB 3.x every trigger will be redone so we'll clean a lot of that up at that point.
With that trigger the first 2 variables are the updated user object and the last 2 are the old user object before changes.
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.