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

request-project form submission errors #2

Closed bradfordcondon closed 5 years ago

bradfordcondon commented 5 years ago

Not sure if these are a generic tripal site problem/missing dependency, or just pre-existing errors

Notice: Use of undefined constant FROM_ADDRESS - assumed 'FROM_ADDRESS' in request_project_submit() (line 177 of /Users/chet/UTK/tripal/sites/all/modules/custom/datasets/includes/datasets_request_project.form.inc).
Notice: Undefined index: cordinator_name in datasets_mail() (line 203 of /Users/chet/UTK/tripal/sites/all/modules/custom/datasets/datasets.module).
Notice: Undefined index: SHA512 in datasets_mail() (line 207 of /Users/chet/UTK/tripal/sites/all/modules/custom/datasets/datasets.module).
Notice: Use of undefined constant FROM_ADDRESS - assumed 'FROM_ADDRESS' in request_project_submit() (line 184 of /Users/chet/UTK/tripal/sites/all/modules/custom/datasets/includes/datasets_request_project.form.inc).
Notice: Undefined index: cordinator_name in datasets_mail() (line 203 of /Users/chet/UTK/tripal/sites/all/modules/custom/datasets/datasets.module).
Notice: Undefined index: SHA512 in datasets_mail() (line 207 of /Users/chet/UTK/tripal/sites/all/modules/custom/datasets/datasets.module).

ported from: https://gitlab.com/i5k_Workspace/datasets/issues/17

bradfordcondon commented 5 years ago

related: #21

FROM_ADDRESS: I switched from constants to variable_set/get so we can switch to an admin form for setting this stuff.

The other two errors are from $params in the mail function not being set. THey are in this array:

 $data = [
    'genus' => check_plain($values['genus']),
    'species' => check_plain($values['species']),
    'ncbi_taxid' => check_plain($values['ncbi_taxid']),
    'common_name' => check_plain($values['common_name']),
    'genome_assembly_hosted' => check_plain($values['is_genome_assembly']),
    'is_ncbi_submitted' => check_plain($values['is_ncbi_submitted']),
    'is_assembly' => check_plain($values['is_assembly']),
    'involved_in_generation' => check_plain($values['involved_in_generation']),
    'description' => trim(check_plain($values['description'])),
    'fullname' => trim(check_plain($values['fullname'])),
    'email' => check_plain($values['email']),
    'created' => $created,
  ];

as we can see, neither of these is set. cordinator_name might perhaps be fullname. we either need to add SHA512, remove from the mail function, or conditionally add and check.