Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
language system
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
4 Jan 2014 at 01:10 UTC
Updated:
29 Jul 2014 at 23:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
plachComment #2
sunComment #3
plachThe parent issue has been committed.
Comment #4
sunComment #5
sunWowza, this is a much larger effort than I imagined.
Attached patch is just
language_list(), and it does not properly injected the language_manager service dependency yet.Perhaps we should split this issue into three discrete issue for the 3 functions?
Comment #6
plachIf we have 50K+ patches for each function, I guess it would definitely make sense to have separate issues. Or maybe we could commit a first pass without DI and then a second one where we'd inject the language manager.
Comment #7
cosmicdreams commentedOK, I started this issue to remove the language_load function before I found this issue:
#2182133: language_load() is deprecated, replace with provided suggestion.
I will focus on removing the language_load function in favor of it's corresponding method from the language manager.
Comment #8
cosmicdreams commentedComment #9
sunGood to hear. So let's create the last missing separate issue for language_default().
To be honest, I did not actually expect this patch here to pass tests... While that is great, we still need to properly inject the language manager where possible.
Comment #10
cosmicdreams commentedYea, it does feel a bit excessive to always be calling the language manager from the global drupal object. I ended up starting an issue for language() as well: #2182257: language() is deprecated, replace with suggested function
Both of the issues I started for this are copy-paste jobs (that I went through change by change to make sure it was done with oversight.
Comment #11
ianthomas_ukRe-roll, also keeps the language_list function itself to reduce the chance of the patch breaking HEAD.
While injecting the language manager is the preferred option, do we need to do it in this patch, which is already 50k? I think we're better replacing all the procedural functions first on a per-function basis, then going through the OO code adding DI on a per-module basis (i.e. replacing all calls to \Drupal::languageManager(), whatever function was eventually being called).
Comment #12
plach+1 on #11
Comment #13
sunComment #14
sun11: 2166915-remove-uses-language-list-11.patch queued for re-testing.
Comment #16
ianthomas_ukComment #17
ianthomas_ukOn second thoughts, this isn't a great candidate for the script
Comment #18
ianthomas_ukThis patch is just a combination / reroll of #11, plus #2182133-1: language_load() is deprecated, replace with provided suggestion. by cosmicdreams.
If we're going to split this up, it would make more sense to do so by file rather than function, as otherwise the sub-issues will conflict with each other, especially when we start doing dependency injection. I'm working on a combined patch, but might split it that way if it gets too large.
Comment #19
ianthomas_ukOK, I've reduced the scope of this issue to cover just tests and procedural code - i.e. places where we don't need to worry about dependency injection. I'll open a separate issue for the OO code.
No interdiff I'm afraid, but I don't think it would have helped much if I had been able to provide one.
Comment #20
ianthomas_ukComment #21
ianthomas_ukComment #22
plachLooks good, thanks. I found only the following minor issue:
80 chars
Not sure whether we actually need a new issue or whether we can just commit the latest patch and then post a new one.
Comment #23
ianthomas_ukI've changed that comment to:
No other changes.
Comment #24
plachThanks!
Comment #25
ianthomas_ukThanks for the review. We don't want to cause unnecessary rerolls of more important patches during drupaldevdays, so postponing for now and I'll reroll this over the weekend if it needs it.
Comment #26
ianthomas_ukActually, this didn't conflict much at all - just two context changes in one test.
Comment #27
webchickCommitted and pushed to 8.x. Thanks!