Commit 78dd47d1 authored by Matthieu Scarset's avatar Matthieu Scarset Committed by mxh
Browse files

Check if field_ui module exists #3304864

parent eece1962
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -87,10 +87,12 @@ function storage_form_storage_type_add_form_alter(&$form, FormStateInterface $fo
 * @see storage_form_storage_type_add_form_alter()
 */
function storage_form_storage_type_add_form_submit($form, FormStateInterface $form_state) {
  if (\Drupal::moduleHandler()->moduleExists('field_ui')) {
    if ($form_state->getTriggeringElement()['#parents'][0] === 'save_continue' && $route_info = FieldUI::getOverviewRouteInfo('storage', $form_state->getValue('id'))) {
      $form_state->setRedirectUrl($route_info);
    }
  }
}

/**
 * Implements hook_views_query_substitutions().