Remove country setting from the installer

Created on 8 April 2024, 10 months ago
Updated 16 July 2024, 6 months ago

Problem/Motivation

The installer asks the site admin for their default country. We don't do anything with this information - it was last used for date formatting which was removed in 2014 (see #2276183: Date intl support is broken, remove it β†’ ) - so we should not ask it in the first place.

For now we can leave the config setting in place, that can be removed in a followup if we decide we don't need it at all.

Before

After

Steps to reproduce

N/A

Proposed resolution

Remove the "default country" dropdown from the installer.
Remove countryManager from form injection.

Remaining tasks

User interface changes

The default country is no longer requested on the install form.

API changes

N/A

Data model changes

N/A

Release notes snippet

  • The default site country option was removed from the drupal site configure form that users see on first install.
  • If your site relies on this setting you will need to visit the RegionForm at Configuration > Region and Language > Regional Settings.
πŸ“Œ Task
Status

Fixed

Version

10.3 ✨

Component
InstallΒ  β†’

Last updated 5 days ago

No maintainer
Created by

πŸ‡¬πŸ‡§United Kingdom longwave UK

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @longwave
  • πŸ‡¬πŸ‡§United Kingdom longwave UK

    Alternatively, if we are to keep this setting, then we should make it useful - for example, it should set up date formats correctly for the country that was selected.

  • First commit to issue fork.
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    I'm curious about this after finding your comment on [1933614]

    I'm going to do a naive attempt for removing it from the form to see which tests fail. I'm also not sure if the Dateformatter can be done separately since it looks for this setting.

  • Merge request !7368Remove default country from install form β†’ (Closed) created by nicxvan
  • Pipeline finished with Success
    10 months ago
    Total: 576s
    #140942
  • πŸ‡«πŸ‡·France andypost

    +1 it could be moved to contrib module

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    So tests pass with this removed. I think this depends on 3439440 πŸ“Œ Remove country support from DateFormatter Active
    Since 3439440 uses this setting and that issue is set to remove it.

    The only other place using this in core other than the mentioned issue is the regional form that you can change the setting.

  • Status changed to Needs work 10 months ago
  • πŸ‡¬πŸ‡§United Kingdom longwave UK

    The date formatter reads the value but never uses it, so this can be done first if needed.

    We can remove CountryManager from the form here, it's not used any more.

  • Status changed to Active 10 months ago
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    This might be a dumb question, but I can't actually remove it, I need to follow this right? https://www.drupal.org/about/core/policies/core-change-policies/drupal-d... β†’

  • Pipeline finished with Success
    10 months ago
    Total: 604s
    #141029
  • πŸ‡¬πŸ‡§United Kingdom longwave UK

    Yup we should try to provide backwards compatibility in case anyone has extended the form.

  • Assigned to nicxvan
  • Status changed to Needs work 10 months ago
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    I'm actually not sure of the best way to handle this since the next property is a new item with a deprecation warning as well.

    Current docblock

    /**
       * Constructs a new SiteConfigureForm.
       *
       * @param string $root
       *   The app root.
       * @param string $site_path
       *   The site path.
       * @param \Drupal\user\UserStorageInterface $user_storage
       *   The user storage.
       * @param \Drupal\Core\Extension\ModuleInstallerInterface $module_installer
       *   The module installer.
       * @param \Drupal\Core\Locale\CountryManagerInterface $country_manager
       *   The country manager.
       * @param \Drupal\user\UserNameValidator|null $userNameValidator
       *   The user validator.
       */
    

    Is the right thing to do is to add usernamevalidator as a type hint option on to $country_manager
    and check to see if country manager is the country manager or username?

    There can be confusion because there is a new deprecation from 3 days ago on username validation.

  • Issue was unassigned.
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    I made an attempt at deprecating it.

    I think this approach depends on it getting in before the next release though since the constructor just changed last week.
    If this does not get in we probably need to deprecate this differently and keep the optional username validator.

  • Pipeline finished with Canceled
    10 months ago
    Total: 177s
    #141071
  • Pipeline finished with Failed
    10 months ago
    Total: 175s
    #141076
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    There was some discussion in slack between, chx, catch and myself about whether deprecations are necessary.

    The conclusion is that it is more necessary for services to prevent contrib breakage, and it is attempted in most cases where possible.

    Changing deprecations within a minor release is also fine as far as I can tell, so this should be good. I'll move to needs review if the tests still pass.

  • Pipeline finished with Success
    10 months ago
    Total: 1245s
    #141081
  • Status changed to Needs review 10 months ago
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    Also @berdir pointed out that the installer is explicitly not part of BC.

  • πŸ‡ΊπŸ‡ΈUnited States dww

    I was about to RTBC, but I noticed something fishy with the $deprecatedProperties definition. Added an MR suggestion about it.

    Other than that, I think this is ready.

    Thanks!
    -Derek

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    I applied @dww's suggestion and also took a screenshot of the new install page.

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    I'm also going to write a change record since I assume it is needed for a change like this.

  • Pipeline finished with Success
    10 months ago
    Total: 657s
    #141152
  • πŸ‡³πŸ‡ΏNew Zealand quietone
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    This is changing the UI so adding tag per
    https://www.drupal.org/about/core/policies/core-change-policies/core-gat... β†’ . This should also have before and after screenshots that a reviewer can find from the Issue Summary.

    Ideally, this should also provide the issue where the use of the date formatting was removed.

    I think this should have a usability review because not only is is changing the UI it is changing the a form in the install process. I am adding the tag but correct me if I am wrong.

  • Status changed to RTBC 10 months ago
  • πŸ‡ΊπŸ‡ΈUnited States dww
    • The changes in the MR are entirely within core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php and now look proper.
    • The deprecation dance looks good to me.
    • Pipeline is all green.
    • Summary and title are clear and accurate.
    • The CR is short and sweet, no complaints.
    • There's even a screenshot of the installer after the change, although I don't think that was strictly necessary. πŸ˜…

    Ooof, x-post with @quietone. Replying to #23:

    I'm not sure what a UX team review would add here. This is a totally useless setting that has no impact on core behavior. Less is more. Removing things from the installer we don't need is a good thing. There's 0% chance that a UX review would say: "nah, we should keep asking something that core completely ignores during people's very first impression of Drupal". πŸ˜…

    Meanwhile, adding a before screenshot, and embedding both in the summary.

    I believe this is now RTBC.

    Thanks,
    -Derek

  • πŸ‡ΊπŸ‡ΈUnited States dww

    p.s. Re:

    Ideally, this should also provide the issue where the use of the date formatting was removed.

    See comment #8 and related issues. Int'l date formatting was removed at #2276183: Date intl support is broken, remove it β†’ . Added that to the summary, too.

    Cheers,
    -Derek

  • πŸ‡³πŸ‡ΏNew Zealand quietone

    @dww, thanks for updating the Issue Summary! I know that can be tedious.

    I now see the original issue in the Issue Summary. Thanks! Yes, I did not read this entire issue for that information, I was relying on the Issue Summary.

    I read the original issue and didn't find any specific mention of the country field in the installer. The closest I found was a sentence in the related change record that support might be added back at some future date. Removing the field does not change that it could be added back. So, that resolves any concern that I had.

    Thanks again.

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    I changed the deprecation notice to be more accurate so it's not confusing since it is still required.

    with the $userNameValidator argument as CountryManagerInterface is deprecated in drupal:10.3.0 and will be required in drupal:11.0.0
    

    is now:

    with the $userNameValidator argument as CountryManagerInterface is deprecated in drupal:10.3.0 and must be UserNameValidator in drupal:11.0.0
    
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    Fixing summary content I accidentally changed.

  • Pipeline finished with Success
    10 months ago
    Total: 692s
    #141198
    • nod_ β†’ committed 68365af0 on 11.x
      Issue #3439439 by nicxvan, dww, longwave, andypost, quietone: Remove...
    • nod_ β†’ committed 6d49a11e on 10.3.x
      Issue #3439439 by nicxvan, dww, longwave, andypost, quietone: Remove...
  • Status changed to Fixed 10 months ago
  • πŸ‡«πŸ‡·France nod_ Lille

    Committed 68365af and pushed to 11.x. Thanks!

  • Automatically closed - issue fixed for 2 weeks with no activity.

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    Tagging for release not inclusion.

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan
  • πŸ‡¦πŸ‡ΊAustralia pameeela

    @nicxvan could you expand on why you think this change should be called out? The setting doesn't do anything. Why would it be disruptive for it to not be set on a new install?

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    @pamneela good point actually. Existing sites already have the setting. New installs of core don't need it. And for people that need it after installing they have the change record. I've untagged.

    Sorry for the confusion.

  • πŸ‡¦πŸ‡ΊAustralia pameeela

    Thanks for confirming.

  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    I think this issue should have considered contrib. There are usages there, especially in commerce sites. Especially in commerce - including code that assumes it is set. See http://codcontrib.hank.vps-private.net/search?text=country.default&filen... - especially the default country resolver.

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    It was considered, we opened an issue specifically in Commerce to discuss it beforehand and they had only added it in a couple months before so were not opposed to removing it again.

    I also built a list and opened issues in project where it could be an issue: https://www.drupal.org/project/address/issues/3444987 πŸ“Œ \Drupal::config('system.date')->get('country.default') now has validation and can now be null Active

    I then also searched contrib, almost all instances were distributions that contained core committed. I then created issues for contrib and highlighted the change, almost all instances used it as a fallback so nothing should have broken.

Production build 0.71.5 2024