Browse Source

Merge pull request #5 from tripal/7.x-3.x

7.x 3.x
Abdullah Almsaeed 7 years ago
parent
commit
b5605de3e2

+ 4 - 1
tripal/tripal.module

@@ -1057,7 +1057,10 @@ function tripal_html5_file_validate($element, &$form_state) {
   $is_required = $element['#required'];
   $is_required = $element['#required'];
   $name = $element['#name'];
   $name = $element['#name'];
   $name = preg_replace('/[^\w]/', '_', $name);
   $name = preg_replace('/[^\w]/', '_', $name);
-  $fid = $element['#value'][$name];
+  $fid = NULL;
+  if (is_array($element['#value']) and $array_key_exists($name, $element['#value'])) {
+    $fid = $element['#value'][$name];
+  }
 
 
   // TODO: the fid should just be the $element['#value'] why isn't this
   // TODO: the fid should just be the $element['#value'] why isn't this
   // working given the tripal_html5_file_value function below.
   // working given the tripal_html5_file_value function below.

+ 1 - 1
tripal_chado/includes/TripalFields/sio__annotation/sio__annotation.inc

@@ -292,7 +292,7 @@ class sio__annotation extends ChadoField {
         'value' => array(
         'value' => array(
           $vocabulary => $cvterm->dbxref_id->db_id->name,
           $vocabulary => $cvterm->dbxref_id->db_id->name,
           $accession => $cvterm->dbxref_id->accession,
           $accession => $cvterm->dbxref_id->accession,
-          $definition => $cvterm->definition
+          $definition => isset($cvterm->definition) ? $cvterm->definition : ''
         ),
         ),
         'chado-' . $field_table . '__' . $pkey => $linker->$pkey,
         'chado-' . $field_table . '__' . $pkey => $linker->$pkey,
         'chado-' . $field_table . '__' . $fkey_lcolumn => $linker->$fkey_lcolumn,
         'chado-' . $field_table . '__' . $fkey_lcolumn => $linker->$fkey_lcolumn,