Bläddra i källkod

Fixes for PHP 7.2 compatibility and typo on call to API function

Stephen Ficklin 6 år sedan
förälder
incheckning
841ea989ea

+ 13 - 11
tripal/includes/TripalJob.inc

@@ -160,17 +160,19 @@ class TripalJob {
     }
 
     $includes = $details['includes'];
-    foreach ($includes as $path) {
-      $full_path = $_SERVER['DOCUMENT_ROOT'] . base_path() . $path;
-      if (!empty($path)) {
-        if (file_exists($path)) {
-          require_once($path);
-        }
-        elseif (file_exists($full_path)) {
-          require_once($path);
-        }
-        elseif (!empty($path)) {
-          throw new Exception("Included files for Tripal Job must exist. This path ($full_path) doesn't exist.");
+    if ($path and is_array($path)) {
+      foreach ($includes as $path) {
+        $full_path = $_SERVER['DOCUMENT_ROOT'] . base_path() . $path;
+        if (!empty($path)) {
+          if (file_exists($path)) {
+            require_once($path);
+          }
+          elseif (file_exists($full_path)) {
+            require_once($path);
+          }
+          elseif (!empty($path)) {
+            throw new Exception("Included files for Tripal Job must exist. This path ($full_path) doesn't exist.");
+          }
         }
       }
     }

+ 1 - 1
tripal_chado/api/tripal_chado.query.api.inc

@@ -1037,7 +1037,7 @@ function chado_delete_record($table, $match, $options = NULL) {
   foreach ($delete_matches as $field => $value) {
     // If we have an array values then this is an "IN" clasue.
 
-    if (count($value) > 1) {
+    if (is_array($value) and count($value) > 1) {
       $sql .= "$field IN (";
       $index = 0;
       foreach ($value as $v) {

+ 1 - 1
tripal_chado/includes/TripalImporter/TaxonomyImporter.inc

@@ -312,7 +312,7 @@ class TaxonomyImporter extends TripalImporter {
     $lineage_nodes[] = array();
 
     // Get the "rank" cvterm. It requires that the TAXRANK vocabulary is loaded.
-    $rank_cvterm = tripal_chado_get_cvtermget_cvterm(array(
+    $rank_cvterm = chado_get_cvterm(array(
       'name' => 'rank',
       'cv_id' => array('name' => 'local')
     ));