Stephen Ficklin hace 7 años
padre
commit
d6506d7905
Se han modificado 1 ficheros con 11 adiciones y 0 borrados
  1. 11 0
      tripal_chado/api/modules/tripal_chado.feature.api.inc

+ 11 - 0
tripal_chado/api/modules/tripal_chado.feature.api.inc

@@ -362,7 +362,18 @@ function tripal_get_feature_sequences($feature, $options) {
         // Iterate through the sub features and concat their sequences. They
         // should already be in order.
         $i = 0;
+        $already_processed_children = array();
         while ($child = $children->fetchObject()) {
+          // In some cases, a feature may be discontinuous (i.e. one feature
+          // spread over several positions). In this case, the feature will
+          // appear multiple times and we want to prevent addition of the
+          // sequence multiple times.  A simple check to make sure we haven't
+          // seen the feature already should suffice.
+          if (count($already_processed_children) > 0 and in_array($child->feature_id, $already_processed_children)){
+            continue;
+          }
+          $already_processed_children[] = $child->feature_id;
+
           // If the callee has specified that only certain sub features should be
           // included then continue if this child is not one of those allowed
           // subfeatures.