function jsonapi_install in Drupal 10
Same name and namespace in other branches
- 8 core/modules/jsonapi/jsonapi.install \jsonapi_install()
- 9 core/modules/jsonapi/jsonapi.install \jsonapi_install()
Implements hook_install().
File
- core/
modules/ jsonapi/ jsonapi.install, line 13 - Module install file.
Code
function jsonapi_install() {
$module_handler = \Drupal::moduleHandler();
$potential_conflicts = [
'content_translation',
'config_translation',
'language',
];
$should_warn = array_reduce($potential_conflicts, function ($should_warn, $module_name) use ($module_handler) {
return $should_warn ?: $module_handler
->moduleExists($module_name);
}, FALSE);
if ($should_warn) {
\Drupal::messenger()
->addWarning(t('Some multilingual features currently do not work well with JSON:API. See the <a href=":jsonapi-docs">JSON:API multilingual support documentation</a> for more information on the current status of multilingual support.', [
':jsonapi-docs' => 'https://www.drupal.org/docs/8/modules/jsonapi/translations',
]));
}
}