Skip to Content Skip to Menu

CB Query Fields: Can't get Default to work on Query Drop Down

3 days 1 hour ago #344248 by BobBriscoe
I've built a country selector following this tutorial . Works fine, except the 'Default' option seems to have no effect.

Illustrative example page .
Full backend CB config details at the end, but in brief:
CB > Fields > select_my_field > Global tab > Default: GB

I've checked for
  • leading or trailing spaces around 'GB' in my CB config
  • leading or trailing spaces in the option elements in the DOM
  • It uses a simple 2-column country database pulled off the web. So, to eliminate that, I also switched temporarily to the one linked from the tutorial (made no difference).
__________________
This seems such a simple thing I can't believe it might be a bug. But I've also spent far too long trying to work out whether I've done something wrong.


My config:
Joomla 5.4.7
CB 2.11.0+build.2026.03.09.15.07.44.b34f2745a (latest as at time of posting)

Potentially relevant non-default CB settings
  • CB > Field Management > cb_country > 
    • Global tab >
      • Type: Query Drop Down (single select)
      • Label: --- select country --- (I also tried empty string)
      • Show on Profile: No
      • Default Registration Value: GB (I also tried other country codes)
      • Size 1
    • Parameters tab
      • Query tab >
        • SELECT `iso`, `country` FROM `#__country_info` ORDER BY `country`
          • (I tried switching the order to country, iso and various other combinations)
      • Options tab >
        • Value Column: iso
        • Label Column: country

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 50577
  • Thanks: 8662
  • Karma: 1473
3 days 35 minutes ago #344249 by krileon
Hmm that should be working fine. Have added a bug ticket to investigate further. It's possible the default is trying to validate and apply before the query options have populated.

forge.joomlapolis.com/issues/9900


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.

2 days 12 hours ago #344251 by BobBriscoe
Validation is not enabled.

If it was I'd have listed it among all the non-default settings I gave.
That list is comprehensive. If anything is set at its default it will not be listed there.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 50577
  • Thanks: 8662
  • Karma: 1473
7 hours 12 minutes ago - 7 hours 11 minutes ago #344254 by krileon
I apologize I didn't mean field validation itself. What happens is the default registration value is validated against the list of available options before being set in the HTML. What I was saying is that likely isn't working against the query options. I'll be investigating that today to fix if I find an issue with it.


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.
Last edit: 7 hours 11 minutes ago by krileon.

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

7 hours ago #344256 by BobBriscoe
Thx. Understood

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 50577
  • Thanks: 8662
  • Karma: 1473
6 hours 43 minutes ago #344259 by krileon
I was not able to confirm an issue with the field by itself. However you have the field inside of a field group. I was able to confirm the default doesn't work when it's inside of a field group. So looks like a CB Field Groups bug. Have added a bug ticket for that and am continuing investigation.

forge.joomlapolis.com/issues/9901


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