Skip to Content Skip to Menu

🌟 CB Editor Assistant 1.0.0 is here! Discover our new AI Joomla Plugin that wrote its story! (and this banner!)
Start at just $12.50/month* or 💸 save 30% with our 🛍️ Black Friday Intro Offer for your subscription's lifetime
🎉 Black Friday sale is here! Great savings on professional and developer memberships! Get 25% off now with code BLACK-FRIDAY-2024!

Auto Action Trigger after DB updating a field in comprofiler table

  • MMDoege
  • MMDoege
  • OFFLINE
  • Posts: 98
  • Thanks: 3
  • Karma: 0
6 years 3 months ago #306903 by MMDoege
Looking for an Auto Action triggered after executing a DB statement updating a field in user profile.

Trigger onAfterUpdateUser seems not to be suitable here as it does not fire.
Is a trigger specific to Joomla required?

Thank you.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48560
  • Thanks: 8292
  • Karma: 1445
6 years 3 months ago #306909 by krileon
onAfterUserUpdate is fired when a user is updated from frontend and onAfterUpdateUser is fired when a user is updated from backend. Use either of those or both depending on your needs. Their variables are all the same with var1 and var2 being the up to date user object and var3 being the object before changes were applied. So you can check if a field changed its value with the following condition

[var1_field_name] Not Equal To [var3_field_name]


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.
The following user(s) said Thank You: nant

Please Log in or Create an account to join the conversation.

  • MMDoege
  • MMDoege
  • OFFLINE
  • Posts: 98
  • Thanks: 3
  • Karma: 0
6 years 3 months ago #306925 by MMDoege
This is exactly how we do it with most of our Auto Actions.

However, in this case, neither the frontend user nor backend admin initiates the update but an application.
The app simply switches a flag in comprofiler from 1 to 0 because a subscription has expired.
This hides a CB Tab from being display and it executes properly.

But consequently an Auto Action is required to do some housekeeping:
1) unpublish a CB Content Module
2) delete some content from user's profile

For this transaction we're looking for correct type of trigger listening to DB updates.
onAfterUpdateUser seems not to work here.

Thank you.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48560
  • Thanks: 8292
  • Karma: 1445
6 years 3 months ago #306938 by krileon
I can't help you in regards to your application updating users. Your application isn't firing CB triggers when making the changes, which it's probably just doing directly on the database. This means CB Auto Actions can't do anything for you.


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.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum