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] Use substitutions in CB auto actions

  • beneymard
  • beneymard
  • OFFLINE
  • Posts: 87
  • Thanks: 6
  • Karma: 1
9 years 1 month ago - 9 years 1 month ago #270384 by beneymard
Hello,

I am using CB 2.0 and CB Auto actions and I have a question.
I want to prevent an user to connect with another user if they have the value of the field "cb_field" so I used an autoactions with the trigger "Before add connection request". In the conditions tab I wrote "[cb:userdata field="cb_field" user="[var1]"/]" equals to "[cb:userdata field="cb_field" user="[var2]"/]". It does not work as expected and I do not understand why. I tried to solve the problem by testing the substitutions in a message and it shows the text [cb:userdata field="cb_field" user="524"/] and [cb:userdata field="cb_field" user="525"/]. I think I wrote something bad in the substitutions but I wrote the same thing than explained here :https://www.joomlapolis.com/support/tutorials/107-use-cases/18353-using-substitutions-throughout-cb

It is the exact same code and the ids are substituted well so I do not understand why this is not working.
I would be very grateful for any kind of help.

Thanks in advance,

Pierre
Last edit: 9 years 1 month ago by beneymard.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
9 years 1 month ago #270419 by krileon
Replied by krileon on topic Use substitutions in CB auto actions
That's a substitution within a substitution. That won't work due the parsing order of substitutions in CB where extra substitutions (like [var1-10] usages) are parsed last. As neither of the triggers that fire before a connection is established contain a user object you'll only be able to condition off of one of the user objects as CB Auto Actions will likely try to load the id into a user object.


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.

  • beneymard
  • beneymard
  • OFFLINE
  • Posts: 87
  • Thanks: 6
  • Karma: 1
9 years 1 month ago #270425 by beneymard
Replied by beneymard on topic Use substitutions in CB auto actions
Thanks a lot. I did not think of the parsing order. I will only display one name then.

Thanks for the great support.

Pierre

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

Moderators: beatnantkrileon
Powered by Kunena Forum