To reproduce:
1. enable a location field (node_location, user_location, location_cck, etc).
2. set "collection settings" to require location
3. set "collection settings" to require State/Province
4. set "collection settings" to collect Country
5. go to the object's add page (e.g. node/add)
4. Choose a country with no states/provinces or an unsupported country, e.g. "Bouvet Island", "British Virgin Islands", "Christmas Island", "Falkland Islands", "Faroe Islands", "French Guiana", "Gibraltar", "Guadeloupe", "Guam", "Guernsey", "Isle of Man", "Jersey", "Lebanon", "Macedonia", "Martinique", "Mayotte", "Montenegro", "Netherlands Antilles", "Niue", "Norfolk Island", "Palestinian Territory", "Pitcairn", "Reunion", "Serbia", "Singapore", "Slovenia", "South Georgia and the South Sandwich Islands", "Svalbard and Jan Mayen", "Western Sahara", "Vatican", etc.
5. Try to save the object
6. Unable to save with validation error: "State/Province field is required."
Comments
Comment #1
gregstout CreditAttribution: gregstout commentedWe have this problem too. We require location city/province/country. When some user enters, for instance, Singapore, then they cannot get registered because the country has no listed regions/provinces in the "supported" location.sg.inc file.
Has anyone solved this?
Comment #2
jessehssubscribing
Comment #3
YesCT CreditAttribution: YesCT commentedPlease check to see if this is still a problem in the new release. If it is, reply with a new summary and set the status back to active. (maybe search on validate)
Comment #4
AaronBaumanSame issue, same behavior as OP.
Comment #5
AaronBaumanI think the solution is going to have to go something like the following:
1. unset #required for "state/province" even when location settings set it as required.
2. add the visual indication to the UI that state/province is required (the red asterisk).
3. use validation handler to require state/province when applicable, ignore when not applicable
4. add javascript to hide, disable, or otherwise indicate that "state/province" is not applicable when a country without states/provinces is chosen.
Let me know if that sounds like a good way to go, or if you have any feedback, and I'll work on a patch.
Comment #6
rooby CreditAttribution: rooby commentedThis is way old but I jsust came across it.
The solution outlined in #5 sounds good to me.
Comment #7
datarazor CreditAttribution: datarazor commentedI'm surprised this is still an issue that hasn't been addressed. For many countries there are no provinces and the province/state field should not be displayed (hidden) when it doesn't apply. Since the field uses auto-complete you can't just use JS to hide the field and need to do it with some PHP.
Comment #8
datarazor CreditAttribution: datarazor commented