Skip to Content Skip to Menu

Countries and cities

  • ericmuc
  • ericmuc
  • OFFLINE
  • Posts: 390
  • Thanks: 30
  • Karma: 2
  • Add-ons
3 years 8 months ago #323753 by ericmuc
Replied by ericmuc on topic Countries and cities
Hi,

I tested it now several times and changed some setting. But my situation is with the latest plugin versions:

1) all ok without being part of a field group !
2) cities not saved if both, country and city fields, are part of a field group

I am working with both field as "Query Drop Down (Multi-select)".
Code:
SELECT *, CONCAT_WS(' / ', city, subcountry, country) AS label FROM #__cities WHERE FIND_IN_SET( country_3code, REPLACE( '[cb_country]', '|*|', ',' ) ) > 0

Options:
Value Column = geonameid
(unique id)

Label Column = label

Can you please check this?

Thanks, best regards
Eric

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

  • ericmuc
  • ericmuc
  • OFFLINE
  • Posts: 390
  • Thanks: 30
  • Karma: 2
  • Add-ons
3 years 8 months ago #323755 by ericmuc
Replied by ericmuc on topic Countries and cities
Hi,

I can set Display on profiles as "ordered list", by this the choosen values comes as

1. value 1
2. value 2
and so on

The order I can normally set in the query with ORDER BY column ASC/DESC.

But is there a possibility to get the order exactly in the same order as the values were picked out of the drop down list. So the first value will become the 1. value and the second 2. value, no matter in which order they are in the drop down list?

And is it possible to get the choosen values in the profile edit dropable with the mouse so that the order for the profile view can be determined?

Thanks, best regards
Eric

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
3 years 8 months ago #323764 by krileon
Replied by krileon on topic Countries and cities

ericmuc wrote: Hi,

I tested it now several times and changed some setting. But my situation is with the latest plugin versions:

1) all ok without being part of a field group !
2) cities not saved if both, country and city fields, are part of a field group

I am working with both field as "Query Drop Down (Multi-select)".

Code:
SELECT *, CONCAT_WS(' / ', city, subcountry, country) AS label FROM #__cities WHERE FIND_IN_SET( country_3code, REPLACE( '[cb_country]', '|*|', ',' ) ) > 0

Options:
Value Column = geonameid
(unique id)

Label Column = label

Can you please check this?

Thanks, best regards
Eric

I've already tested this as working perfectly fine with chaining query selects in a field group. The below is a permanent test case that I used during all field group regression testing. I've retested it again as working fine.

Name: cb_fieldgroup_country
Type: Query Drop Down (Single Select)
Query:
Code:
SELECT `country_iso_code2`, `country_name` FROM `#__comprofiler_countries`
Value Column: country_iso_code2
Label Column: country_name

Name: cb_fieldgroup_state
Type: Query Drop Down (Single Select)
Query:
Code:
SELECT `province_iso_code`, `province_name` FROM `#__comprofiler_provinces` WHERE `country_iso_code2` = '[cb_fieldgroup_country]'
Value Column: province_iso_code
Label Column: province_name
Update On: cb_fieldgroup_country

This will update the state dropdown based off the selected country. The above uses the tables provided by CBSubs Tax integration for CBSubs. Both values save perfectly fine. Try making your query more specific with the following and see if that helps.

Code:
SELECT `geonameid`, CONCAT_WS(' / ', `city`, `subcountry`, `country`) AS label FROM `#__cities` WHERE FIND_IN_SET( `country_3code`, REPLACE( '[cb_country]', '|*|', ',' ) ) > 0

But is there a possibility to get the order exactly in the same order as the values were picked out of the drop down list. So the first value will become the 1. value and the second 2. value, no matter in which order they are in the drop down list?

No, it will always follow the order of the options in the dropdown.

And is it possible to get the choosen values in the profile edit dropable with the mouse so that the order for the profile view can be determined?

The order of the field group rows? Yes, turn on sorting within your field group field. If you mean in the dropdown then no.


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.

  • ericmuc
  • ericmuc
  • OFFLINE
  • Posts: 390
  • Thanks: 30
  • Karma: 2
  • Add-ons
3 years 8 months ago #323775 by ericmuc
Replied by ericmuc on topic Countries and cities
Hi,
Thanks.
Now I made the test and switches both Query Drop Down (Multi Select) to Query Drop Down (Single Select) type.
That works also in a field group.
But not if both are Query Drop Down (Multi Select).
Can you please check this?
Thanks, best regards
Eric

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
3 years 8 months ago #323776 by krileon
Replied by krileon on topic Countries and cities
Ah, yup the country field being a multiselect causes the state field to fail to save due to the country value still being an array causing the substitution to fail. I see the issue and am working on a fix. New CB Field Groups build should be out sometime today fixing the issue.

forge.joomlapolis.com/issues/8416


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: 48541
  • Thanks: 8290
  • Karma: 1445
3 years 8 months ago #323777 by krileon
Replied by krileon on topic Countries and cities
This is now fixed in latest CB Field Groups build release available now.


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

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

Moderators: beatnantkrileon
Powered by Kunena Forum