Two small issues in \Drupal\locale\Form\ImportForm::submitForm:
- bulk.inc is required 2 times
- translation.inc doesn't use the ModuleHandler that comes with the ImportForm class
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | locale_form-import_module-handler_2887259-2.patch | 1.12 KB | tessa bakker |
| #2 | locale_form-import_module-handler_2887259-2_U10.txt | 1.12 KB | tessa bakker |
Comments
Comment #2
tessa bakkerPatch attached.
The .txt version is with more lines, so you can see that bulk.inc is already required.
Comment #4
sutharsan commentedPatch still applies. Code changes makes sense. Tests passed. Manually tested to import a translation file for a not yet existing translation.
All works as expected.
Comment #7
xjmThanks @Tessa Bakker, nice spot.
I checked with git blame and this was introduced in #2095787: Configuration translations not updated when manually importing a .po file. The module handler service was already injected as a dependency at that time and already used elsewhere in the class, so it looks like just an oversight. I also checked the original issue for anything else we might need to clean up and there was none. So, there's no need to expand the scope of this issue for other replacements of
\Drupal::moduleHandler()elsewhere.Since this is just a code cleanup with no functional impact or disruption, I've also backported it to 8.4.x.
Comment #8
xjmFixing credit again.