Browse Source

temporary fix to fields validate

Stephen Ficklin 8 years ago
parent
commit
2d4c8a4f4f

+ 2 - 2
tripal/includes/TripalField.inc

@@ -67,10 +67,10 @@ class TripalField {
     $this->field_type = get_class($this);
 
     // Determine if this field can attach to the bundle.
-    $this->setCanAttach($bundle, $details);
+    $this->setCanAttach();
 
     // Set the field's name.
-    $this->setFieldName($bundle, $details);
+    $this->setFieldName();
   }
 
   /**

+ 1 - 0
tripal/includes/tripal.entity.inc

@@ -298,6 +298,7 @@ function tripal_entity_view($entity, $type, $view_mode, $langcode) {
       $child = $entity->content[$child_name];
       if (array_key_exists('#items', $child) and
           array_key_exists('0', $child['#items']) and
+          is_array($child['#items'][0]) and
           array_key_exists('#unattached', $child['#items'][0])
           and $child['#items'][0]['#unattached'] === TRUE) {
         $entity->content[$child_name]['#prefix'] .= '<div id="tripal-entity-' . $entity->id . '--' . $child_name . '" class="tripal-entity-unattached">';

+ 1 - 1
tripal_chado/includes/fields/chado_linker__dbxref.inc

@@ -247,7 +247,7 @@ class chado_linker__dbxref extends TripalField {
 
     $widget['#table_name'] = $chado_table;
     $widget['#fkey_field'] = $fkey;
-    $widget['#element_validate'] = array('chado_linker__dbxref_widget_validate');
+    //$widget['#element_validate'] = array('chado_linker__dbxref_widget_validate');
     $widget['#theme'] = 'chado_linker__dbxref_widget';
     $widget['#prefix'] =  "<span id='$field_name-dbxref--db-id-$delta'>";
     $widget['#suffix'] =  "</span>";

+ 8 - 4
tripal_chado/includes/fields/chado_linker__prop_adder.inc

@@ -30,7 +30,7 @@ class chado_linker__prop_adder extends TripalField {
     $cv_id      = $this->details['chado_cv_id'];
     $cvterm_id  = $this->details['chado_cvterm_id'];
 
-    // If the linker table does not exists then we don't want to add attach.
+    // If the linker table does not exist then we don't want to add attach.
     $prop_table = $table_name . 'prop';
     if (chado_table_exists($prop_table)) {
       $this->can_attach = TRUE;
@@ -134,9 +134,6 @@ class chado_linker__prop_adder extends TripalField {
   static function widgetForm(&$widget, &$form, &$form_state,
       $field, $instance, $langcode, $items, $delta, $element) {
 
-    // This field has no value field.  Just a fieldset for adding new properties.
-    $widget['#element_validate'] = array('chado_linker__prop_adder_widget_validate');
-
     $widget['#type'] = 'fieldset';
     $widget['#title'] = $element['#title'];
     $widget['#description'] = $element['#description'];
@@ -177,6 +174,13 @@ class chado_linker__prop_adder extends TripalField {
     );
   }
 
+  /**
+   * @see TripalField::widgetFormValidate
+   */
+  public static function widgetFormValidate($entity_type, $entity, $field, $instance, $langcode,
+      $items, &$errors) {
+
+  }
 }
 /**
  * Callback function for validating the chado_linker__prop_adder_widget.