Deprecate locale_system_set_config_langcodes()

Created on 31 January 2023, almost 2 years ago
Updated 24 January 2024, 10 months ago

Problem/Motivation

๐Ÿ› Installing a module causes translations to be overwritten Fixed moves the functionality of locale_system_set_config_langcodes() into LocaleConfigManager. This issue will deprecate the old method and replace any remaining usages. It will also have a change record to inform developers.

Proposed resolution

Add deprecation
Remove usages

Remaining tasks

None

User interface changes

None

API changes

locale_system_set_config_langcodes() is deprecated.

Data model changes

None

Release notes snippet

N/a

๐Ÿ“Œ Task
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Localeย  โ†’

Last updated 3 days ago

Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom alexpott ๐Ÿ‡ช๐Ÿ‡บ๐ŸŒ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Issue created by @alexpott
  • Status changed to Active over 1 year ago
  • ๐Ÿ‡ญ๐Ÿ‡บHungary pasqualle ๐Ÿ‡ญ๐Ÿ‡บ Budapest
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom alexpott ๐Ÿ‡ช๐Ÿ‡บ๐ŸŒ

    None of the usages in tests are necessary because the default language in these cases is en so it's doing absolutely nothing.

    I don't think adding a test to call locale_system_set_config_langcodes () to prove the deprecation is worth it in this case.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ต๐Ÿ‡นPortugal ricardofaria

    I can confirm that this patch is working.
    Applying both patches(parent and this one), it works.

  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom alexpott ๐Ÿ‡ช๐Ÿ‡บ๐ŸŒ

    Fixed the test I broke. It's good that \Drupal\Tests\locale\Kernel\LocaleConfigSubscriberForeignTest exists - unfortunately not real enough to have discovered ๐Ÿ› Installing a module causes translations to be overwritten Fixed but at least the inner workings of LocaleConfigSubscriber are tested with a different default language.

    @ricardofaria thank you for looking into this issue.

    Posting screenshots of your codebase or command-line interface does not advance the issue, since the automated testing infrastructure tells us whether the change set still applies correctly.

    So, I have not granted issue credit for that screenshot. In the future, you can get credit for issues by reading the issue to understand its purpose, and posting your review or testing of that purpose. Thank you!

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost

    Failure is unrelated but I'm curious why UserMailNotifyTest.php does not need replacement?

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost

    Not sure it needs deprecation test

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom alexpott ๐Ÿ‡ช๐Ÿ‡บ๐ŸŒ

    @andypost UserMailNotifyTest doesn't have a different default language. This method only does something when that is true. UserMailNotifyTest adds other languages but it does not set them as a default.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Can we add a test case for the deprecation message.

  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom alexpott ๐Ÿ‡ช๐Ÿ‡บ๐ŸŒ

    I'm not convinced that a test is truly necessary but /shrug here one is - and at least it tests the functionality. Testing the message is probably the least important part - testing that we have not broke the functionality (and don't while the method is still around) is the one reason in favour of adding tests like this.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Gotcha. Been under the mindset that deprecation should always have tests. Got a good rule of thumb for when that's not the case?

    Build errors on the patch.

  • Status changed to Needs review over 1 year ago
  • last update over 1 year ago
    29,381 pass
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rassoni Bangalore

    Fixed CCF failed.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost

    It's 10.2 target, makes sense to update patch

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia pooja saraah Chennai

    Replaced the deprecated function call locale_system_set_config_langcodes() with the suggested replacement \Drupal\locale\LocaleConfigManager::updateDefaultConfigLangcodes()
    These changes should ensure compatibility with Drupal 11.0.0 while addressing the deprecation warnings.
    Attached patch against Drupal 11 and interdiff file.

  • last update 10 months ago
    Composer error. Unable to continue.
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost

    Please open mr and deprecation should ne in 10.3.0

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost

    Please open mr and deprecation should ne in 10.3.0

Production build 0.71.5 2024