The purpose of locale_modules_installed()
is updating translations after new modules are installed.
It calls locale_system_update($components)
, which creates a batch with batch_set()
, but it is not called in a form context and there is no batch_process()
call
.
This means that locale_modules_installed()
does not update translations for any installed module.
Comments
Comment #7
pameeela CreditAttribution: pameeela commentedThanks for reporting this issue. We rely on issue reports like this one to resolve bugs and improve Drupal core.
As part of the Bug Smash Initiative, we are triaging Drupal core issues with the priority 'Major'.
It's not clear why this bug would meet the criteria for major so I am setting it to 'Normal'.
@undertext are you able to provide more information about how to reproduce this and the problem this causes? This is best done by providing complete steps to reproduce the issue (starting from "Install Drupal core") in the issue summary.
Comment #8
pameeela CreditAttribution: pameeela commentedComment #9
apadernoComment #10
apadernolocale_modules_installed()
adds a batch callingbatch_set()
, but sincebatch_process()
isn't called, that batch will not be processed. Even ifbatch_process()
were called, the batch is set to progressive, which means it would be processed only when a user starts it from the user interface.Comment #11
apadernoActually, the
'progressive'
key isn't set, so the batch will finish in a single run. Adding a call tobatch_process()
should be sufficient to be sure the batch operations are processed.I take there isn't a test checking that the batch operations added from
locale_modules_installed()
are executed, or that test would fail. If this is the case, tests need to be added.Comment #12
apadernoThe code hasn't changed in Drupal 9.1.x, where
locale_system_update()
is still callingbatch_set()
but notbatch_process()
.I guess this needs to be fixed in Drupal 9.1.x and back-ported to Drupal 9.0.x and 8.9.x.
Comment #16
larowlanAdding the novice tag because I think adding the batch_process call here can be done by a new contributor
What is the impact of this not running? Translations don't get imported? I guess if you're running this via the UI it's in a form, so it's really drush specific - which probably means we're into minor territory
Comment #20
apaderno