Hi Kyle!
Thanks
immensely for your response.
Well, truth be told I am trying to fix a piece of code I wrote years ago that reacts to one of the three possible events along the path to getting a new user approved (depending on how CB is setup). How to update the profile choices (multi-select checkbox fields) depends on data queried from non-Joomla database tables based on email address. The desire is to "check all the appropriate boxes" in the user field based on the way my CB plugin is configured. In other words, this started out as my own plugin but this part of it has never worked and I never figured out why.
In the query style Auto-Action the query looks like this:
Code:
UPDATE #__comprofiler SET cb_fieldname = 'Account Email' WHERE user_id=[user_id];
The code in my plugin does the exact same thing but obviously doesn't have the luxury of [user_id] like an Auto-Action does and obviously has to use Joomla API database query methods. Anyway, when this is done in response to any of the three events (from memory, so pardon if not exact names) onAfterUserApproval, onAfterUserConfirmed, or onAfterUserRegistration, whether in my plugin or as an Auto-Action, the value 'Account Email' never appears in the comprofiler cb_fieldname column (checked via phpMyAdmin), which appears untouched (still NULL).
Using the Auto-Action Query action type was my attempt to see if it is WHEN I am trying to do this that is the issue versus HOW I am doing it. I know the query is valid because I can issue it in phpMyAdmin and it works perfectly. So my take-away is that something is either blocking the UPDATE query or something else happens later in the time line (after the event is handled) that undoes it.
My plugin code still uses the "old style" Joomla database methods:
Code:
db->setQuery("UPDATE ...");
db->execute();
In this plugin, those non-Joomla database tables are also being updated this way and all those queries work. So I've just started to believe something else is going on that is thwarting my queries. Although the Auto-Action "fix" (with the Field action) does work, it's disjoint from my plugin, so not an ideal solution.
Thanks again for your assistance.
Bruce