NAL-i5K / tripal_chado_datasets

Provides an admin layer and forms for users to submit organisms and analysis into Chado
0 stars 0 forks source link

lost organism validation when using chado API #45

Closed bradfordcondon closed 6 years ago

bradfordcondon commented 6 years ago

In theory, organism validation comes out of the box with the chado_get_organism_select API, but we dont have it. (I've previously written in the validation myself but was told thats not necessary) I'm talking with Tripal team about this.

Related: #38

bradfordcondon commented 6 years ago

yikes, apparently the api doesnt follow best practices. this is what was recommended by lacey


  $organism_options = chado_get_organism_select_options(FALSE);

  unset($organism_options[0]);

  $form['general_information']['organism'] = [
    '#type' => 'select',
    '#title' => t('Organism'),
    '#options' => $organism_options,
    '#multiple' => FALSE,
    '#required' => TRUE,
    '#prefix' => '<div class="col-lg-6">',
    '#suffix' => '</div>',
    '#empty_option' => 'Select an organism'
  ];