Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

[SOLVED] CB Auto Actions: Assigning usergroup based on CB field value

  • joesca
  • joesca
  • OFFLINE
  • Posts: 4
  • Thanks: 1
  • Karma: 0
8 years 5 months ago - 8 years 5 months ago #281542 by joesca
Hi all,
my goal is to have users assigned automatically to differents gropus while register.

I have installed last CB 2.0.14 on a fresh new Joomla 3.5.1 installation.

I have read the CB Auto Assign tutorial at www.joomlapolis.com/support/tutorials/107-use-cases/18237-cb-auto-actions-assigning-usergroup-based-on-cb-field-value but I always have users added to registered Group only.

That is what I did:
- D/L the last CB Auto Assign version 6.3.5
- Installed it via CB Plugin Management
- Installed CB Query Field 5.0.4
- Created 2 new Users Group under the -Registered Group Parent
- Created 2 new Level under the Viewing Acces Levels , assigning "itself" and "registered" as "User Groups Having Viewing Access"
- CB Auto Action has the default value set to publish so it's published
- Created 2 new differents Triggers, using onAfterUserRegistration and [cb:parse function="usertype"] equal to the name of the values I have set in the 2 radio button I have added to the registration form. Then I have selected under the action tab: MODE > Add Usergroups and GROUPS > Registered and then selected the name only of the Groups which I want the users belongs to (I mean "registered" and the new one group, depending on the radio button option he has selected while registering. I have also tried to select the new Groups only and not also the registered one but I got the same result: user will be added to the reistered groups ONLY.

Any suggestion?
Thank you so much.
Regards
Joe
Last edit: 8 years 5 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
8 years 5 months ago #281547 by krileon
Please read the below carefully as the usage still applies even though the tutorial is older.

www.joomlapolis.com/support/tutorials/107-use-cases/18237-cb-auto-actions-assigning-usergroup-based-on-cb-field-value

You just need to condition against the field value directly and add the respective usergroup based off the value. Specifically the below condition usage.

[cb_usertype] Equal To Teacher

You'll need 1 action per usergroup you want to assign.


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, joesca

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

  • joesca
  • joesca
  • OFFLINE
  • Posts: 4
  • Thanks: 1
  • Karma: 0
8 years 5 months ago - 8 years 5 months ago #281559 by joesca
Hi krileon and thank you so much fro your quick reply.
As I described in my previous post, I have first tested the old tutorial but I got the users added to the "registered" group only.

Here are some screenshot from my settings:

Added 2 new User Groups > Azienda and > Privato with "Registered" as parent group


Added 2 new items under the Acces Level Menu




Added 1 new Field with 2 Radio Buttons > cb_azienda



Added 2 new actions by using CB Auto Actions (cb_usertype equal to Azienda and cb_usertype equal to Privato)





Also tested adding the Registered group but got the same result.


FYI Registration Form is at www.wallcities.com/demo/index.php/cb-registration/registers

Any workaround or other plugin to adopt for my goal?

Regards
joe
Last edit: 8 years 5 months ago by joesca.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
8 years 5 months ago #281590 by krileon
Enable debug mode and maximum error reporting in Joomla global configuration. Next within your actions under Parameters turn on debugging. Now retest and if it errors or the conditions fail it will output that it has done so. If no errors and conditions passed you likely have a conflict coming from another user store being triggered that's overriding the usergroup additions; try using Replace Usergroups. Also note the trigger you're using only works in frontend so testing in backend won't work.

Please also ensure you've the latest nightly build installed found below.

www.joomlapolis.com/downloads/doc_details/669-cb-auto-actions-nightly-release


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

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

  • joesca
  • joesca
  • OFFLINE
  • Posts: 4
  • Thanks: 1
  • Karma: 0
8 years 5 months ago - 8 years 5 months ago #281638 by joesca
Thank you Kyle.
I have upgraded the Plugi IN to the last night build but I always get this error;

string(78) ":: Azione 40 :: Condizionale 1 fallita per 655: [cb_usertype] Uguale a Azienda" string(78) ":: Azione 39 :: Condizionale 1 fallita per 655: [cb_usertype] Uguale a Privato"



And 20 duplicates:


Also tested setting "Replace Usergroups" as per your suggestion.

NOTE
- Tested using the main frontend Register Form .
- Tested also after having upgraded the CB Query Field Plug In to the last nightly build.

Any suggestion?

Regards
joe


UPDATE - It's now working
Looks like I did the wrong cb assignement under the conditions.
I was wrongly calling the cb_usertype field; mine is called cd_azienda.

Thank you for your support ! :)
regards
joe
Last edit: 8 years 5 months ago by joesca.
The following user(s) said Thank You: krileon

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

Moderators: beatnantkrileon
Powered by Kunena Forum