Two small issues in \Drupal\locale\Form\ImportForm::submitForm:

  1. bulk.inc is required 2 times
  2. translation.inc doesn't use the ModuleHandler that comes with the ImportForm class

Comments

Tessa Bakker created an issue. See original summary.

tessa bakker’s picture

Assigned: tessa bakker » Unassigned
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new1.12 KB
new1.12 KB

Patch attached.
The .txt version is with more lines, so you can see that bulk.inc is already required.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

sutharsan’s picture

Status: Needs review » Reviewed & tested by the community

Patch 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.

  • xjm committed a603e0f on 8.5.x
    Issue #2887259 by Tessa Bakker, Sutharsan: Code style issues of...

  • xjm committed 4981d1a on 8.4.x
    Issue #2887259 by Tessa Bakker, Sutharsan: Code style issues of...
xjm’s picture

Version: 8.5.x-dev » 8.4.x-dev
Status: Reviewed & tested by the community » Fixed

Thanks @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.

xjm’s picture

Fixing credit again.

Status: Fixed » Closed (fixed)

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