function system_update_11400

Same name and namespace in other branches
  1. 11.x core/modules/system/system.install \system_update_11400()

Install Help Search module if the Search and Help modules are installed.

File

core/modules/system/system.install, line 42

Code

function system_update_11400() : void {
  // This needs to be a system update so it runs before other updates in order
  // to get the new help_search plugin in place as early as possible.
  $module_handler = \Drupal::moduleHandler();
  if ($module_handler->moduleExists('help')) {
    \Drupal::database()->schema()
      ->dropTable('help_search_items');
    if (\Drupal::moduleHandler()->moduleExists('search')) {
      \Drupal::service('module_installer')->install([
        'search_help',
      ]);
    }
  }
}

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