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] How to refer to a registration field in a Dblookup query

  • krileon
  • krileon
  • ONLINE
  • Posts: 48465
  • Thanks: 8280
  • Karma: 1443
11 years 4 months ago #229571 by krileon
Strange, everything looks correct. Please PM backend super administrator login credentials as well as phpmyadmin credentials (only need viewing rights for database).


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.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48465
  • Thanks: 8280
  • Karma: 1443
11 years 4 months ago #229605 by krileon
Have debugged the issue and it appears to be a problem in DB Lookup Fieldtype. I've passed Nick the following information so can be reviewed for a new release if necessary.

Query:
Code:
SELECT `codice` FROM `pazienti` WHERE `nome` = '[firstname]' AND `cognome` = '[lastname]' AND `pa_uslcode`= '[value]' AND `userid` is null
Debug:
Code:
SELECT `codice` FROM `pazienti` WHERE `nome` = '[firstname]' AND `cognome` = '[lastname]' AND `pa_uslcode`= 'REMOVED' AND `userid` is null

With the above you can see in "Debug", which is the debug results of the query shown at the bottom of the page that the substitutions never replaced.


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.

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
11 years 4 months ago #229645 by nant
Thanks to Kyle for proposing this fix (which will be added to next version).

For now please edit the dblookupfield.php file

Around line 163 add this line:

$dbl_CBuser->_cbuser = $user;

right after this one:

$dbl_CBuser = & CBUser::getInstance((int) $user->id);

That should so the trick.
The following user(s) said Thank You: krileon

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

  • erichf
  • erichf
  • OFFLINE
  • Posts: 50
  • Thanks: 6
  • Karma: 1
11 years 4 months ago #229826 by erichf
Great to see this very simple fix. Thanks.

Could the same functionality be implemented through an Autoaction | Query? We can query the database but the success or failure of the SQL query doesn't seem to affect whether the autoaction proceeds or not.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48465
  • Thanks: 8280
  • Karma: 1443
11 years 4 months ago #229829 by krileon
CB Auto Actions already populates the user object properly. CB Query Field doesn't act on any particular trigger so no, it can only act on a user that already exists (which is the case if you're using the after registration trigger then using a query field in your conditional for example).


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.

  • zandar
  • zandar
  • OFFLINE
  • Posts: 7
  • Thanks: 2
  • Karma: 0
11 years 3 months ago #230131 by zandar
All is ok now.
Thanks again
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