Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This regression was introduced via #140783: A select list without #default_value always passes form validation.
If you install a clean new copy of D7 after that patch, the installer defaults the country selection to 'Afghanistan' (the first in the list). It used to default to '- None -'.
Not sure if this is major, beta blocker, or what. But, webchick wanted a new issue for this so I'm getting it started...
Comment | File | Size | Author |
---|---|---|---|
#10 | 934110-10.installer_no_default_country.patch | 1.84 KB | dww |
#5 | 934110-default-country.patch | 1.31 KB | Damien Tournoud |
#3 | 934110-default-country.patch | 759 bytes | Damien Tournoud |
#1 | 934110-1.installer_no_default_country.patch | 705 bytes | dww |
Comments
Comment #1
dwwNo idea if this is the best solution here, but this is what the admin UI does at admin/config/regional/settings. WFM on a clean install. If we wanted to exactly replicate the pre #140783 UI we could easily use t('- None -') here, instead of being consistent with admin/config/regional/settings...
Comment #2
Damien Tournoud CreditAttribution: Damien Tournoud commentedThe best way would be to add
#empty_value => ''
to this element (assuming I understand the other issue correctly).Comment #3
Damien Tournoud CreditAttribution: Damien Tournoud commentedIndeed.
Comment #4
dwwShouldn't we do the same in system_regional_settings() then?
Comment #5
Damien Tournoud CreditAttribution: Damien Tournoud commentedIndeed.
Comment #6
markabur CreditAttribution: markabur commentedLooks good. Tested #5, default country is back to "- None -".
Comment #7
sunYes, that's correct, for both.
BTW, can someone explain me WTF this Default country is? It's only ever set in the installer, only get in System regional settings, and the description does not explain what it "could" be good for.
Powered by Dreditor.
Comment #8
sunThat said, that's a different issue.
Comment #9
dwwIf we're fixing system_regional_settings() we need to do it right. One sec, I'll re-roll.
Comment #10
dwwLike so...
Comment #11
tstoecklerRTBC if it comes back green.
Comment #12
juan_g CreditAttribution: juan_g commentedsun wrote:
It seems to have been introduced for D7 core by #333156: Add ability to configure site default country. They said:
This country setting (for time zones, languages, date formats, etc.) is also provided for D6 by the Site Country module, used by Country code. Both seem to be experimental modules.
Comment #13
juan_g CreditAttribution: juan_g commentedIt's green now...
Comment #14
webchickYay!! Committed to HEAD!
(Sorry, Damien, I was too eager to commit this and missed your name on the commit message. I'll add you twice next time.)