Browse Source

Checked in by Stephen

Shawna Spoor 7 years ago
parent
commit
7df0ebc0b2
2 changed files with 20 additions and 2 deletions
  1. 2 2
      tripal_chado/api/modules/tripal_chado.cv.api.inc
  2. 18 0
      tripal_chado/tripal_chado.module

+ 2 - 2
tripal_chado/api/modules/tripal_chado.cv.api.inc

@@ -458,7 +458,7 @@ function tripal_update_cvtermpath_loop($origin, $child_id, $cv_id, $type_id, $de
     }
 
     // Build the ID.
-    $children_id = $origin.$child_id.$cv_id.$type_id;
+    $children_id = $origin.'|'.$child_id.'|'.$cv_id.'|'.$type_id;
 
     // Now check if the most recent entry already exists in the array.
     if($increment_of_depth != 0){
@@ -467,7 +467,7 @@ function tripal_update_cvtermpath_loop($origin, $child_id, $cv_id, $type_id, $de
         if ($val['build_id'] === $children_id) {
           $possible_loop_start = $val;
           watchdog('debug', '<pre>tripal_update_cvtermpath_loop_checker  $val: '. print_r($val, TRUE) .'</pre>');
-
+          die();
           // If the search returns something check for a possible loop.
           //if(!empty($possible_loop_starts)){
             //foreach($possible_loop_starts as $possible_loop_start){

+ 18 - 0
tripal_chado/tripal_chado.module

@@ -707,6 +707,24 @@ function tripal_chado_theme($existing, $type, $theme, $path) {
       $chado_table = $mapped_table->chado_table;
       $legacy_template = 'legacy_template--chado_' . $chado_table;
       if (key_exists($legacy_template, $enabled_templates) && $enabled_templates[$legacy_template]) {
+        //Find the row in the ds_layout_settings table associated with the
+        // bundle_id and delete it.
+        db_delete('ds_layout_settings')
+          ->condition('entity_type', 'TripalEntity')
+          ->condition('bundle', $bundle->name)
+          ->execute();
+
+        // Delete all custom field_sets and field_groups.
+        db_delete('tripal_ds')
+          ->condition('entity_type', 'TripalEntity')
+          ->condition('bundle', $bundle->name)
+          ->execute();
+
+        // Delete the entries from the tripal_ds table.
+        db_delete('field_group')
+          ->condition('bundle', $bundle->name)
+          ->execute();
+
         $themes['TripalEntity__' . $bundle->name] = array(
           'template' => 'node--chado-generic',
           'render element' => 'entity',