function language_modules_installed in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/language/language.module \language_modules_installed()
Implements hook_modules_installed().
1 call to language_modules_installed()
- language_modules_uninstalled in core/
modules/ language/ language.module - Implements hook_modules_uninstalled().
File
- core/
modules/ language/ language.module, line 312 - Add language handling functionality to Drupal.
Code
function language_modules_installed($modules) {
if (!in_array('language', $modules)) {
$negotiator = \Drupal::service('language_negotiator');
$negotiator
->updateConfiguration(array());
$negotiator
->purgeConfiguration();
}
else {
// In language_entity_base_field_info_alter() we are altering view/form
// display definitions to make language fields display configurable. Since
// this is not a hard dependency, and thus is not detected by the config
// system, we have to clean up the related values manually.
foreach (array(
'entity_view_display',
'entity_form_display',
) as $key) {
$displays = \Drupal::entityManager()
->getStorage($key)
->loadMultiple();
/** @var \Drupal\Core\Entity\Display\EntityDisplayInterface $display */
foreach ($displays as $display) {
$display
->save();
}
}
}
}