Problem/Motivation
#2806009: Installing a module causes translations to be overwritten 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
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | interdiff_14-17.txt | 2.33 KB | pooja saraah |
| #17 | 3337900-17.patch | 4.53 KB | pooja saraah |
Issue fork drupal-3337900
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
pasqualleComment #3
alexpottNone of the usages in tests are necessary because the default language in these cases is
enso 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.Comment #5
ricardofaria commentedI can confirm that the patch on #3 is working.
Applying both patches(parent and this one), it works.
Comment #6
alexpottFixed the test I broke. It's good that \Drupal\Tests\locale\Kernel\LocaleConfigSubscriberForeignTest exists - unfortunately not real enough to have discovered #2806009: Installing a module causes translations to be overwritten 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!
Comment #8
andypostFailure is unrelated but I'm curious why
UserMailNotifyTest.phpdoes not need replacement?Comment #9
andypostNot sure it needs deprecation test
Comment #10
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.
Comment #11
smustgrave commentedCan we add a test case for the deprecation message.
Comment #12
alexpottI'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.
Comment #13
smustgrave commentedGotcha. 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.
Comment #14
rassoni commentedFixed CCF failed.
Comment #15
andypostIt's 10.2 target, makes sense to update patch
Comment #17
pooja saraah commentedReplaced the deprecated function call locale_system_set_config_langcodes() with the 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.
Comment #18
andypostPlease open mr and deprecation should ne in 10.3.0
Comment #19
andypostPlease open mr and deprecation should ne in 10.3.0
Comment #20
andypostComment #24
prem suthar commentedRe-rolled the patch As per #20 and as per the #19 updated the version from 10.3.1 to 10.3.0.
Comment #25
prem suthar commentedPlease review the MR !11274 .
Comment #26
smustgrave commentedLeft comments on the MR
@prem suthar thanks for rerolling but typically is advised when rerolling to also review the MR too as things or numbers need to be updated.
Thanks.
Comment #27
prem suthar commented@smustgrave please review the changes .
Comment #28
smustgrave commentedStill has open threads.