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!

Changing approval workflow based on CB field value

  • Aurra
  • Aurra
  • OFFLINE
  • Posts: 4
  • Thanks: 2
  • Karma: 0
6 years 10 months ago - 6 years 10 months ago #300915 by Aurra
Hi,

i have a problem to change the approval workflow.

I'm using that www.joomlapolis.com/documentation/291-cb-auto-actions/tutorials/18219-cb-auto-actions-changing-approval-workflow-based-on-cb-field-valueTutorial

I want to do this:

1. User send the Registration Form

If cb_county field is not 'none' DO

2. Moderator has to check the application

If application is approved DO

3. Assign Usergroup = 'cb_county'

i created 4 autoactions:

1. Query
Trigger: onAfterUserConfirm
User: automatic
access: everybody
condition: [cb_county] is not none
action:
Code:
UPDATE `#__comprofiler` SET `approved`= '0' WHERE `user_id` = '[user_id]'
Modus: internal

2. Query
Trigger: onAfterUserConfirm
User: automatic
access: everybody
condition: [cb_county] is not none
action:
Code:
UPDATE `#__users` SET `block`= '1' WHERE `id`= '[user_id]'
Modus: internal

3. email
Trigger: onAfterUserConfirm
User: automatic
access: everybody
condition: [cb_county] is not none
action:
Code:
username: [username] name: [name] county: [cb_county] id: [user_id]

4. usergroup
trigger: onAfterUserApproval
user: automatic
access: everybody
condition: [cb_county] is Test
Action: Assign usergroup => Test


My problem is every new user with [cb_county] = Test is directly approved and has the group Registered.
I get the email from autoaction #3 like username: Jonny name: Jonny Smith county: Test id: 119
Last edit: 6 years 10 months ago by Aurra.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48560
  • Thanks: 8292
  • Karma: 1445
6 years 10 months ago #300920 by krileon
You're acting on after confirmation. So they're immediately registered as normally. For your auto actions to work they need to become confirmed. Do you have confirmation enabled within CB > Configuration > Registration and are clicking the confirmation URL emailed to them?


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: Aurra

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

  • Aurra
  • Aurra
  • OFFLINE
  • Posts: 4
  • Thanks: 2
  • Karma: 0
6 years 10 months ago - 6 years 10 months ago #300922 by Aurra
Sorry that i wasn't exact.
Yes email confirmation is enabled and the emails are send. And AFTER using the link in the email the user is approved and has the group registrated.
And the email from auto action #4 is send. But auto actions #1-3 are not working. There is no application which has to be approved by a cb moderator.

For your auto actions to work they need to become confirmed


With that you mean instead of onAfterUserConfirm i should use the trigger onAfterUserConfirmation?`
I changed that and now it is working!

two more questions.

1. Where can i set a user as a cb moderator?
2. Is there an overview of the triggers with a short description?

Thank you for you help.
Last edit: 6 years 10 months ago by Aurra.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48560
  • Thanks: 8292
  • Karma: 1445
6 years 10 months ago #300936 by krileon

With that you mean instead of onAfterUserConfirm i should use the trigger onAfterUserConfirmation?`

Both should work unless a user store is being done after your changes causing them to revert. Using onAfterUserConfirmation is fine though and as it's working for you I recommend just continuing to use it.

1. Where can i set a user as a cb moderator?

Users are given CB Moderator permission based off the Moderator View Access Level configured in CB > Configuration > Moderation. If they've a usergroup within that view access level they'll have moderator permissions.

2. Is there an overview of the triggers with a short description?

No descriptions, but an overview can be found below. Most of the newer triggers are self explanatory (or at least we're trying to name them as such).

www.joomlapolis.com/documentation/279-community-builder/tutorials/18358-using-cb-triggers


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: Aurra

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

Moderators: beatnantkrileon
Powered by Kunena Forum