function simple_node_importer_template_submit_handler in Simple Node Importer 8
Same name and namespace in other branches
- 7 simple_node_importer.module \simple_node_importer_template_submit_handler()
Submit handler for simple_node_importer_template_submit_handler.
1 string reference to 'simple_node_importer_template_submit_handler'
- simple_node_importer_form_alter in ./
simple_node_importer.module - Implements hook_form_alter().
File
- ./
simple_node_importer.module, line 400 - Simple node importer module file.
Code
function simple_node_importer_template_submit_handler(&$form, FormStateInterface &$form_state) {
$selected_entity_type = $form_state
->getValue('field_select_entity_type')[0]['value'];
if ($selected_entity_type == 'node') {
$selected_content_type = $form_state
->getValue('field_select_content_type')[0]['value'];
}
else {
$selected_content_type = $selected_entity_type;
}
if ($selected_content_type) {
\Drupal::service('snp.get_services')
->snpSelectCreateCsv($selected_entity_type, $selected_content_type);
}
}