Browse Source

Fixed issue #255

Stephen Ficklin 7 years ago
parent
commit
630f3d99ff
1 changed files with 19 additions and 0 deletions
  1. 19 0
      tripal_chado/includes/tripal_chado.fields.inc

+ 19 - 0
tripal_chado/includes/tripal_chado.fields.inc

@@ -187,6 +187,16 @@ function tripal_chado_bundle_fields_info_base(&$info, $details, $entity_type, $b
     if ($column_name == 'uniquename') {
       $base_info['settings']['text_processing'] = 0;
     }
+
+    // Sometimes the boolean fields are listed as integer.  We need to
+    // correct for that.
+    if ($column_name == 'is_obsolete' or $column_name == 'is_analysis' or
+        $column_name == 'is_relationshiptype' or $column_name == 'is_for_definition' or
+        $column_name == 'is_view' or $column_name == 'is_updateable') {
+      $base_info['type'] = 'list_boolean';
+      $base_info['settings']['allowed_values'] = array(0 => "No", 1 => "Yes");
+    }
+
     //
     // PUB TABLE
     //
@@ -935,6 +945,15 @@ function tripal_chado_bundle_instances_info_base(&$info, $entity_type, $bundle,
       $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.';
     }
+
+    // Sometimes the boolean fields are listed as integer.  We need to
+    // correct for that.
+    if ($column_name == 'is_obsolete' or $column_name == 'is_analysis' or
+        $column_name == 'is_relationshiptype' or $column_name == 'is_for_definition' or
+        $column_name == 'is_view' or $column_name == 'is_updateable') {
+      $base_info['widget']['type'] = 'options_onoff';
+      $base_info['required'] = FALSE;
+    }
     //
     // ORGANISM TABLE
     //