function jsonapi_install

Same name in other branches
  1. 9 core/modules/jsonapi/jsonapi.install \jsonapi_install()
  2. 10 core/modules/jsonapi/jsonapi.install \jsonapi_install()
  3. 11.x core/modules/jsonapi/jsonapi.install \jsonapi_install()

Implements hook_install().

File

core/modules/jsonapi/jsonapi.install, line 13

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',
        ]));
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.