|  | @@ -554,7 +554,7 @@ function tripal_chado_bundle_fields_info_custom(&$info, $details, $entity_type,
 | 
	
		
			
				|  |  |        ),
 | 
	
		
			
				|  |  |      );
 | 
	
		
			
				|  |  |    } 
 | 
	
		
			
				|  |  | -  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |    // Analysis Id
 | 
	
		
			
				|  |  |    if (array_key_exists('analysis_id', $schema['fields'])) {
 | 
	
		
			
				|  |  |      $field_name = 'operation__analysis';
 | 
	
	
		
			
				|  | @@ -569,7 +569,6 @@ function tripal_chado_bundle_fields_info_custom(&$info, $details, $entity_type,
 | 
	
		
			
				|  |  |        ),
 | 
	
		
			
				|  |  |      );
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  /**
 | 
	
	
		
			
				|  | @@ -717,8 +716,24 @@ function tripal_chado_bundle_fields_info_linker(&$info, $details, $entity_type,
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |        $field_name = strtolower(preg_replace('/[^\w]/','_', $term->dbxref_id->db_id->name . '__' . $term->name));
 | 
	
		
			
				|  |  | -      $field_name = substr($field_name, 0, 32);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      // The field name can only be 32 chars, but if our name is longer we need
 | 
	
		
			
				|  |  | +      // to add some random chars to ensure we don't have naming conflicts 
 | 
	
		
			
				|  |  | +      // with other terms (e.g. mitochondrial_genetic_code and 
 | 
	
		
			
				|  |  | +      // mitochondrial_genetic_code_name)
 | 
	
		
			
				|  |  | +      if (strlen($field_name) >= 32) {
 | 
	
		
			
				|  |  | +        $field_name = substr($field_name, 0, 20) . '_' . $term->cvterm_id;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  |        $field_type = 'chado_linker__prop';
 | 
	
		
			
				|  |  | +      
 | 
	
		
			
				|  |  | +      // Don't try to add a property that uses the same term as another field.
 | 
	
		
			
				|  |  | +      if (array_key_exists($field_name, $info)) {
 | 
	
		
			
				|  |  | +        tripal_report_error('chado_fields', TRIPAL_WARNING, 
 | 
	
		
			
				|  |  | +          'A field of type !type already exists, yet a property wants to use the same term. The property cannot be added.',
 | 
	
		
			
				|  |  | +         ['!type' => $field_name],
 | 
	
		
			
				|  |  | +         ['drupal_set_message' => TRUE]);
 | 
	
		
			
				|  |  | +        continue;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  |        $info[$field_name] = array(
 | 
	
		
			
				|  |  |          'field_name' => $field_name,
 | 
	
		
			
				|  |  |          'type' => $field_type,
 | 
	
	
		
			
				|  | @@ -848,8 +863,6 @@ function tripal_chado_bundle_instances_info($entity_type, $bundle) {
 | 
	
		
			
				|  |  |    tripal_chado_bundle_instances_info_custom($info, $entity_type, $bundle, $details);
 | 
	
		
			
				|  |  |    tripal_chado_bundle_instances_info_linker($info, $entity_type, $bundle, $details);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -  // dpm($info);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |    return $info;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  }
 | 
	
	
		
			
				|  | @@ -1033,11 +1046,11 @@ function tripal_chado_bundle_instances_info_base(&$info, $entity_type, $bundle,
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      if ($base_info['label'] == 'Timeaccessioned') {
 | 
	
		
			
				|  |  |        $base_info['label'] = 'Time Accessioned';
 | 
	
		
			
				|  |  | -      $base_info['description'] = 'Please enter the time that this record was first added to the database.';
 | 
	
		
			
				|  |  | +      $base_info['description'] = 'The time that this record was first added to the database.';
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      if ($base_info['label'] == 'Timelastmodified') {
 | 
	
		
			
				|  |  |        $base_info['label'] = 'Time Last Modified';
 | 
	
		
			
				|  |  | -      $base_info['description'] = 'Please enter the time that this record was last modified. The default is the current time.';
 | 
	
		
			
				|  |  | +      $base_info['description'] = 'The time that this record was last modified. The default is the current time.';
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      // Sometimes the boolean fields are listed as integer.  We need to
 | 
	
	
		
			
				|  | @@ -1195,6 +1208,8 @@ function tripal_chado_bundle_instances_info_base(&$info, $entity_type, $bundle,
 | 
	
		
			
				|  |  |        if ($column_name == 'name') {
 | 
	
		
			
				|  |  |          $base_info['widget']['type'] = 'text_textfield';
 | 
	
		
			
				|  |  |          $base_info['settings']['text_processing'] = '0';
 | 
	
		
			
				|  |  | +        $base_info['required'] = TRUE;
 | 
	
		
			
				|  |  | +        $base_info['description'] = 'A unique name for this assay..';
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |        if ($column_name == 'protcol_id') {
 | 
	
		
			
				|  |  |          $base_info['label'] = 'Protocol';
 | 
	
	
		
			
				|  | @@ -1203,20 +1218,24 @@ function tripal_chado_bundle_instances_info_base(&$info, $entity_type, $bundle,
 | 
	
		
			
				|  |  |          $base_info['label'] = 'Array Batch Identifier';
 | 
	
		
			
				|  |  |          $base_info['widget']['type'] = 'text_textfield';
 | 
	
		
			
				|  |  |          $base_info['settings']['text_processing'] = '0';
 | 
	
		
			
				|  |  | +        $base_info['description'] = 'A unique identifier for the array batch.';
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |        if ($column_name == 'operator_id') {
 | 
	
		
			
				|  |  |          $base_info['label'] = 'Operator';
 | 
	
		
			
				|  |  | +        $base_info['description'] = 'The individual who performed the assay.';
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |        if ($column_name == 'arrayidentifier') {
 | 
	
		
			
				|  |  |          $base_info['label'] = 'Array Identifier';
 | 
	
		
			
				|  |  |          $base_info['widget']['type'] = 'text_textfield';
 | 
	
		
			
				|  |  |          $base_info['settings']['text_processing'] = '0';
 | 
	
		
			
				|  |  | +        $base_info['description'] = 'A unique alternate identifier for the array.';
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |        if ($column_name == 'arraydesign_id') {
 | 
	
		
			
				|  |  |          $base_info['label'] = 'Array Design';
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |        if ($column_name == 'assaydate') {
 | 
	
		
			
				|  |  |          $base_info['label'] = 'Assay Date';
 | 
	
		
			
				|  |  | +        $base_info['description'] = 'The date the assay was performed';
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      //
 | 
	
	
		
			
				|  | @@ -1304,6 +1323,9 @@ function tripal_chado_bundle_instances_info_custom(&$info, $entity_type, $bundle
 | 
	
		
			
				|  |  |          'base_table' => $table_name,
 | 
	
		
			
				|  |  |          'vocabulary' => $default_vocab,
 | 
	
		
			
				|  |  |          'parent_term' => $parent_term,
 | 
	
		
			
				|  |  | +        'term_vocabulary' => 'schema',
 | 
	
		
			
				|  |  | +        'term_name' => 'additionalType',
 | 
	
		
			
				|  |  | +        'term_accession' => 'additionalType',
 | 
	
		
			
				|  |  |        ),
 | 
	
		
			
				|  |  |        'widget' => array(
 | 
	
		
			
				|  |  |          'type' => 'schema__additional_type_widget',
 | 
	
	
		
			
				|  | @@ -1794,6 +1816,9 @@ function tripal_chado_bundle_instances_info_custom(&$info, $entity_type, $bundle
 | 
	
		
			
				|  |  |          'chado_table' => 'organism',
 | 
	
		
			
				|  |  |          'chado_column' => 'type_id',
 | 
	
		
			
				|  |  |          'base_table' => 'organism',
 | 
	
		
			
				|  |  | +        'term_vocabulary' => 'TAXRANK',
 | 
	
		
			
				|  |  | +        'term_name' => 'infraspecific_taxon',
 | 
	
		
			
				|  |  | +        'term_accession' => '0000046',
 | 
	
		
			
				|  |  |        ),
 | 
	
		
			
				|  |  |        'widget' => array(
 | 
	
		
			
				|  |  |          'type' => 'taxrank__infraspecific_taxon_widget',
 | 
	
	
		
			
				|  | @@ -1995,6 +2020,9 @@ function tripal_chado_bundle_instances_info_custom(&$info, $entity_type, $bundle
 | 
	
		
			
				|  |  |          'chado_table' => $table_name,
 | 
	
		
			
				|  |  |          'chado_column' => 'pub_id',
 | 
	
		
			
				|  |  |          'base_table' => $table_name,
 | 
	
		
			
				|  |  | +        'term_accession' => 'publication',
 | 
	
		
			
				|  |  | +        'term_vocabulary' => 'schema',
 | 
	
		
			
				|  |  | +        'term_name' => 'publication',
 | 
	
		
			
				|  |  |        ),
 | 
	
		
			
				|  |  |        'widget' => array(
 | 
	
		
			
				|  |  |          'type' => 'schema__publication_widget',
 | 
	
	
		
			
				|  | @@ -2157,6 +2185,9 @@ function tripal_chado_bundle_instances_info_linker(&$info, $entity_type, $bundle
 | 
	
		
			
				|  |  |          'chado_table' => $dbxref_table,
 | 
	
		
			
				|  |  |          'chado_column' => $pkey,
 | 
	
		
			
				|  |  |          'base_table' => $table_name,
 | 
	
		
			
				|  |  | +        'term_vocabulary' => 'SBO',
 | 
	
		
			
				|  |  | +        'term_name' => 'Database Cross Reference',
 | 
	
		
			
				|  |  | +        'term_accession' => '0000554',
 | 
	
		
			
				|  |  |        ),
 | 
	
		
			
				|  |  |        'widget' => array(
 | 
	
		
			
				|  |  |          'type' => 'sbo__database_cross_reference_widget',
 | 
	
	
		
			
				|  | @@ -2439,7 +2470,13 @@ function tripal_chado_bundle_instances_info_linker(&$info, $entity_type, $bundle
 | 
	
		
			
				|  |  |           }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |           $field_name = strtolower(preg_replace('/[^\w]/','_', $term->dbxref_id->db_id->name . '__' . $term->name));
 | 
	
		
			
				|  |  | -         $field_name = substr($field_name, 0, 32);
 | 
	
		
			
				|  |  | +         // The field name can only be 32 chars, but if our name is longer we need
 | 
	
		
			
				|  |  | +         // to add some random chars to ensure we don't have naming conflicts
 | 
	
		
			
				|  |  | +         // with other terms (e.g. mitochondrial_genetic_code and
 | 
	
		
			
				|  |  | +         // mitochondrial_genetic_code_name)
 | 
	
		
			
				|  |  | +         if (strlen($field_name) >= 32) {
 | 
	
		
			
				|  |  | +           $field_name = substr($field_name, 0, 20) . '_' . $term->cvterm_id;
 | 
	
		
			
				|  |  | +         }
 | 
	
		
			
				|  |  |           $info[$field_name] = array(
 | 
	
		
			
				|  |  |             'field_name' => $field_name,
 | 
	
		
			
				|  |  |             'entity_type' => $entity_type,
 | 
	
	
		
			
				|  | @@ -2510,6 +2547,9 @@ function tripal_chado_bundle_instances_info_linker(&$info, $entity_type, $bundle
 | 
	
		
			
				|  |  |          'chado_table' => $term_table,
 | 
	
		
			
				|  |  |          'chado_column' => $pkey,
 | 
	
		
			
				|  |  |          'base_table' => $table_name,
 | 
	
		
			
				|  |  | +        'term_vocabulary' => 'SIO',
 | 
	
		
			
				|  |  | +        'term_name' => 'annotation',
 | 
	
		
			
				|  |  | +        'term_accession' => '001166',
 | 
	
		
			
				|  |  |        ),
 | 
	
		
			
				|  |  |        'widget' => array(
 | 
	
		
			
				|  |  |          'type' => 'sio__annotation_widget',
 | 
	
	
		
			
				|  | @@ -2545,6 +2585,9 @@ function tripal_chado_bundle_instances_info_linker(&$info, $entity_type, $bundle
 | 
	
		
			
				|  |  |          'chado_table' => $pub_table,
 | 
	
		
			
				|  |  |          'chado_column' => $pkey,
 | 
	
		
			
				|  |  |          'base_table' => $table_name,
 | 
	
		
			
				|  |  | +        'term_accession' => 'publication',
 | 
	
		
			
				|  |  | +        'term_vocabulary' => 'schema',
 | 
	
		
			
				|  |  | +        'term_name' => 'publication',
 | 
	
		
			
				|  |  |        ),
 | 
	
		
			
				|  |  |        'widget' => array(
 | 
	
		
			
				|  |  |          'type' => 'schema__publication_widget',
 | 
	
	
		
			
				|  | @@ -2617,6 +2660,9 @@ function tripal_chado_bundle_instances_info_linker(&$info, $entity_type, $bundle
 | 
	
		
			
				|  |  |          'chado_table' => $rel_table,
 | 
	
		
			
				|  |  |          'chado_column' => $pkey,
 | 
	
		
			
				|  |  |          'base_table' => $table_name,
 | 
	
		
			
				|  |  | +        'term_vocabulary' => 'SBO',
 | 
	
		
			
				|  |  | +        'term_name' => 'Relationship',
 | 
	
		
			
				|  |  | +        'term_accession' => '0000374',
 | 
	
		
			
				|  |  |        ),
 | 
	
		
			
				|  |  |        'widget' => array(
 | 
	
		
			
				|  |  |          'type' => 'sbo__relationship_widget',
 |