Explorar o código

Removed requirement to have a 'comment' in the views integration import

Stephen Ficklin %!s(int64=12) %!d(string=hai) anos
pai
achega
27dadbfc37

+ 6 - 6
tripal_views/api/tripal_views.api.inc

@@ -137,13 +137,13 @@ function tripal_views_integration_add_entry($defn_array) {
     'base_table' => $defn_array['base_table'],
   );
   if ($defn_array['type'] == 'mview') {
-      $mview = db_fetch_object(db_query("SELECT mview_id FROM {tripal_mviews} WHERE mv_table='%s'", $defn_array['table']));
-      $view_record['mview_id'] = $mview->mview_id;
-      if (!$mview->mview_id) {
-        return FALSE;
-      }
+    $mview = db_fetch_object(db_query("SELECT mview_id FROM {tripal_mviews} WHERE mv_table='%s'", $defn_array['table']));
+    $view_record['mview_id'] = $mview->mview_id;
+    if (!$mview->mview_id) {
+      return FALSE;
+    }
   }
-  if ($view_record['name'] && $view_record['comment']) {
+  if ($view_record['name']) { // && $view_record['comment']) {  # SPF: commented out 9/24/2012 .. It's not required on the form
     if ($defn_array['additional_content']) {
       $setup = db_fetch_object(db_query("SELECT * FROM {tripal_views} WHERE table_name='%s' AND priority=%d",$view_record['table_name'], $view_record['priority']));
       if (empty($setup->setup_id)) {

+ 2 - 2
tripal_views/includes/tripal_views_integration_port.inc

@@ -83,7 +83,7 @@ function tripal_views_integration_import_form_submit($form, &$form_state) {
   //$defn_array = unserialize($form_state['values']['import']);
   // convert the array into a real PHP array
   $defn_array = array();
-  eval("\$t = " . $form_state['values']['import'] . ";");
+  eval("\$defn_array = " . $form_state['values']['import'] . ";");
 
   // Add optional parameters
   if ($form_state['values']['name']) {
@@ -101,4 +101,4 @@ function tripal_views_integration_import_form_submit($form, &$form_state) {
   else {
     drupal_set_message(t("Unable to import %name Integration", array('%name' => $defn_array['name'])), 'error');
   }
-}
+}