Browse Source

Merge branch 'entities' of github.com:tripal/tripal into entities

Stephen Ficklin 9 years ago
parent
commit
7e5014ef59

+ 4 - 6
tripal_entities/includes/tripal_entities.admin.inc

@@ -420,7 +420,7 @@ function tripal_entities_add_bundle_fields($entity_type_name, $bundle_name, $cvt
       // Determine if the field is required.
       $is_required = 0;
       if (array_key_exists('not null', $details) and $details['not null'] === TRUE) {
-        $is_required = $details['not null'] ? 1 : 0;
+        $is_required = array_key_exists('default', $details) ? 0 : 1;
       }
 
       // Determine what type of field this should be.
@@ -473,13 +473,11 @@ function tripal_entities_add_bundle_fields($entity_type_name, $bundle_name, $cvt
           $field_type = 'list_boolean';
           $widget_type = 'options_onoff';
           $settings['allowed_values'] = array(0 => "No", 1 => "Yes");
-          // Turn off the is_required, even if it is because a non-checked
-          // field is a value.
-          $is_required = 0;
           break;
         case 'datetime':
-          //$field_type = 'datestamp';
-          // TODO: What is the proper datetime fields ??????
+          // Use the Drupal Date and Date API to create the field/widget
+          $field_type = 'datetime';
+          $widget_type = 'date_select';
           break;
         default:
           drupal_set_message(t("Unhandled field type: %type", array('%type' => $details['type'])), 'warning');

+ 1 - 1
tripal_entities/tripal_entities.info

@@ -13,5 +13,5 @@ dependencies[] = tripal_views
 dependencies[] = tripal_db
 dependencies[] = tripal_cv
 
-dependencies[] = date_api
+dependencies[] = date
 dependencies[] = entity