فهرست منبع

initial commit with fixes to the obo loader to allow for file references

Shawna Spoor 7 سال پیش
والد
کامیت
69479178c9
2فایلهای تغییر یافته به همراه7 افزوده شده و 3 حذف شده
  1. 5 1
      tripal/includes/tripal.importer.inc
  2. 2 2
      tripal_chado/includes/TripalImporter/OBOImporter.inc

+ 5 - 1
tripal/includes/tripal.importer.inc

@@ -160,7 +160,6 @@ function tripal_get_importer_form_submit($form, &$form_state) {
   unset($run_args['op']);
   unset($run_args['button']);
 
-
   $file_local = NULL;
   $file_upload = NULL;
   $file_remote = NULL;
@@ -195,6 +194,11 @@ function tripal_get_importer_form_submit($form, &$form_state) {
     // Now allow the loader to do it's own submit if needed.
     $importer = new $class();
     $importer->formSubmit($form, $form_state);
+    // If the formSubmit made changes to the $form_state we need to update the
+    // $run_args info.
+    if ($run_args !== $form_state['values']) {
+      $run_args = $form_state['values'];
+    }
 
     // If the importer wants to rebuild the form for some reason then let's
     // not add a job.

+ 2 - 2
tripal_chado/includes/TripalImporter/OBOImporter.inc

@@ -267,7 +267,6 @@ class OBOImporter extends TripalImporter {
    * @see TripalImporter::formSubmit()
    */
   public function formSubmit($form, &$form_state) {
-
     $obo_id    = $form_state['values']['obo_id'];
     $obo_name  = trim($form_state['values']['obo_name']);
     $obo_url   = trim($form_state['values']['obo_url']);
@@ -301,8 +300,10 @@ class OBOImporter extends TripalImporter {
           'path' => $obo_url ? $obo_url : $obo_file,
         ))
         ->execute();
+
         // Add the obo_id to the form_state vaules.
         $form_state['values']['obo_id'] = $obo_id;
+
       if ($obo_id) {
         drupal_set_message(t("The vocabulary !vocab has been added.", array('!vocab' => $obo_name)));
       }
@@ -385,7 +386,6 @@ class OBOImporter extends TripalImporter {
   public function run() {
 
     $arguments = $this->arguments['run_args'];
-
     $obo_id = $arguments['obo_id'];
 
     // Make sure the $obo_id is valid