You are here

function field_group_update_8302 in Field Group 8.3

Install the 'jquery_ui_accordion' module if it exists.

File

./field_group.install, line 48
Update hooks for the Field Group module.

Code

function field_group_update_8302() {
  try {

    // Enables the jQuery UI accordion module if it exists.
    if (\Drupal::service('extension.list.module')
      ->getName('jquery_ui_accordion')) {
      \Drupal::service('module_installer')
        ->install([
        'jquery_ui_accordion',
      ], TRUE);
      return t('The "jquery_ui_accordion" module has been installed.');
    }
  } catch (\Exception $e) {
    return t('If you want to use the Field Group accordion formatter, you will need to install the <a href=":link" target="_blank">jQuery UI Accordion</a> module.', [
      ':link' => 'https://www.drupal.org/project/jquery_ui_accordion',
    ]);
  }
}