You are here

function type_style_moderation_form_workflow_transition_edit_form_submit in Type Style 8

Form submit callback for the transition edit form.

1 string reference to 'type_style_moderation_form_workflow_transition_edit_form_submit'
type_style_moderation_form_workflow_transition_edit_form_alter in modules/type_style_moderation/type_style_moderation.module
Implements hook_form_FORM_ID_alter().

File

modules/type_style_moderation/type_style_moderation.module, line 69
Hook implementations for the Type Style Moderation module.

Code

function type_style_moderation_form_workflow_transition_edit_form_submit(array &$form, FormStateInterface $form_state) {
  $transition_id = $form['id']['#value'];

  /** @var \Drupal\workflows\WorkflowInterface $workflow */
  $workflow = $form_state
    ->getFormObject()
    ->getEntity();
  $type_plugin = $workflow
    ->getTypePlugin();
  $config = $type_plugin
    ->getConfiguration();
  $config['transitions'][$transition_id]['type_style'] = $form_state
    ->getValue('type_style', []);
  $type_plugin
    ->setConfiguration($config);
}