Browse Source

Fixed bug with missing settings in the relationship field

Stephen Ficklin 8 years ago
parent
commit
020eed8650

+ 6 - 1
tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship.inc

@@ -35,6 +35,12 @@ class sbo__relationship extends ChadoField {
     // type. This will create form elements when editing the field instance
     // to allow the site admin to change the term settings above.
     'term_fixed' => FALSE,
+    'relationships' => array(
+      'option1_vocabs' => '',
+      'option2_vocab' => '',
+      'option2_parent' => '',
+      'relationship_types' => '',
+    ),
   );
 
   // The default widget for this field.
@@ -549,7 +555,6 @@ class sbo__relationship extends ChadoField {
       '#default_value' => $this->instance['settings']['relationships']['option1_vocabs'],
       // TODO add ajax here so that the relationship autocomplete below works
     );
-
     $element['relationships']['option2'] = array(
       '#type' => 'item',
       '#title' => '<b>Option #2</b>',

+ 0 - 1
tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship_widget.inc

@@ -15,7 +15,6 @@ class sbo__relationship_widget extends ChadoFieldWidget {
     parent::form($widget, $form, $form_state, $langcode, $items, $delta, $element);
 
     // Get the field settings.
-    $entity = $form['#entity'];
     $field_name = $this->field['field_name'];
     $field_type = $this->field['type'];
     $field_table = $this->instance['settings']['chado_table'];