Skip to Content Skip to Menu

DB query field not substituting in condition of auto-action

  • kdave321
  • kdave321
  • ONLINE
  • Posts: 191
  • Thanks: 24
  • Karma: 1
2 years 11 months ago - 2 years 11 months ago #327499 by kdave321
I'm building a reward system for user interaction, and I give reward points to someone when the person they invited logs in for the first time. I created a db query field, cb_referrer_id, to get the inviter's ID but somehow it doesn't work in my auto-action. It is just:
Code:
SELECT `user_id` FROM `#__comprofiler_plugin_invites` WHERE `user` = '[user_id]' LIMIT 1

I see it working ( the cb_referrer_id field ); it's set correctly when I look at the invited user's profile.

'[cb_referrer_id]' is also correctly translated in the auto-action SQL update.

On the condition I tried enabling "format" and then tried all 3 translate/format/prepare options. I've tried cb_referrer_id not empty and '> 0'. Debug says the condition fails. That's just picking the field "cb_referrer_id" from the select list.

If I use "Value" and "$( '#cb_referrer_id' )" "not empty", it does work. So I am just curious why above does not work.
Last edit: 2 years 11 months ago by kdave321.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
2 years 11 months ago #327510 by krileon
Try the below.

Field: Custom > Value
Custom Value: [cb_referrer_id]
Operator: Greater Than
Value: 0

Selecting it from the dropdown should've worked fine though.


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