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

organism images? #31

Closed bradfordcondon closed 6 years ago

bradfordcondon commented 6 years ago

Clearly the organism image upload is happening somewhere, but where/how?

The readme says

create a "datasets" folder for organism image under sites/default/files/

mpoelchau commented 6 years ago

I do not know what that comment is about... Organism image upload happens by the admin in https://i5k.nal.usda.gov/node/add/chado-organism, and they are stored in sites/default/files

bradfordcondon commented 6 years ago

thanks very interesting. Many of the forms pass around a "image upload" parameter but theres nothing in the form that would allow a user to upload an image, so I was getting a little confused.

If image upload is controlled by the admin then we can get rid of all that, and maybe create a future issue to allow user-uploaded images.

For example in the dataset submission form:

 $form['assembly']['project']['organism_image_filename'] = [
    '#type' => 'textfield',
    '#title' => t('Image file name for your organism page ') . '<a href="' . $base_url . '/image_permission/new" target="_blank" >' . t('(image submission form)') . '</a>',
    // '#description' => t("Provide the image url"),
  ];

looks like that url is for a "filldpdf-form' node, modified in the custom_i5k module.

/**
 *  Implements hook_menu_alter
 */
function custom_i5k_menu_alter(&$items) {
   $items['image_permission/new'] = $items['node/add/fillpdf-form'];
   unset($items['node/add/fillpdf-form']);
}

https://www.drupal.org/project/fillpdf

mpoelchau commented 6 years ago

Ah. I think we used to have a field for an image URL in a previous iteration of the form. So it's probably a relic. I think it should be safe to remove.