Skip to content

Commit

Permalink
Merge pull request #1144 from tripal/1143-tv3-fix_importer_button
Browse files Browse the repository at this point in the history
Tripal Importer button
  • Loading branch information
spficklin committed Jan 4, 2021
2 parents 75cb3e5 + 4ebf772 commit 95e3d45
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tripal/includes/tripal.importer.inc
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,22 @@ function tripal_get_importer_form($form, &$form_state, $class) {
$element_form = $importer->form($element, $form_state);
// Quick check to make sure we had an array returned so array_merge() works.
if (!is_array($element_form)) {
$element_form = arry();
$element_form = array();
}

// Merge the custom form with our default one.
// This way, the custom TripalImporter can use the #weight property
// to change the order of their elements in reference to the default ones.
$form = array_merge($form, $element_form);

$form['button'] = [
'#type' => 'submit',
'#value' => t($class::$button_text),
'#weight' => 10,
];
if ($class::$use_button == TRUE) {
$form['button'] = [
'#type' => 'submit',
'#value' => t($class::$button_text),
'#weight' => 10,
];
}

return $form;
}

Expand Down

0 comments on commit 95e3d45

Please sign in to comment.