Browse Source

Removed layout/fields links from content pages. Fixed bug in chado_table_exists() function.

Stephen Ficklin 8 years ago
parent
commit
45ed176259

+ 18 - 18
tripal/includes/TripalEntityUIController.inc

@@ -92,24 +92,24 @@ class TripalEntityUIController extends EntityDefaultUIController {
       'type' => MENU_LOCAL_TASK,
       'weight' => -8,
     );
-    $items['bio_data/' . $wildcard . '/layout'] = array(
-      'title' => 'Layout',
-      'page callback' => 'drupal_goto',
-      'page arguments' => array(url("admin/structure/bio_data/manage/bio_data_$term_id/display")),
-      'access callback' => 'tripal_entity_access',
-      'access arguments' => array('admin', 1),
-      'type' => MENU_LOCAL_TASK,
-      'weight' => -8,
-    );
-    $items['bio_data/' . $wildcard . '/fields'] = array(
-      'title' => 'Fields',
-      'page callback' => 'drupal_goto',
-      'page arguments' => array(url("admin/structure/bio_data/manage/bio_data_$term_id/fields")),
-      'access callback' => 'tripal_entity_access',
-      'access arguments' => array('admin', 1),
-      'type' => MENU_LOCAL_TASK,
-      'weight' => -8,
-    );
+//     $items['bio_data/' . $wildcard . '/layout'] = array(
+//       'title' => 'Layout',
+//       'page callback' => 'drupal_goto',
+//       'page arguments' => array(url("admin/structure/bio_data/manage/bio_data_$term_id/display")),
+//       'access callback' => 'tripal_entity_access',
+//       'access arguments' => array('admin', 1),
+//       'type' => MENU_LOCAL_TASK,
+//       'weight' => -8,
+//     );
+//     $items['bio_data/' . $wildcard . '/fields'] = array(
+//       'title' => 'Fields',
+//       'page callback' => 'drupal_goto',
+//       'page arguments' => array(url("admin/structure/bio_data/manage/bio_data_$term_id/fields")),
+//       'access callback' => 'tripal_entity_access',
+//       'access arguments' => array('admin', 1),
+//       'type' => MENU_LOCAL_TASK,
+//       'weight' => -8,
+//     );
 
     // Menu item for deleting tripal data entities.
     $items['bio_data/' . $wildcard . '/delete'] = array(

+ 2 - 2
tripal/tripal.module

@@ -543,8 +543,8 @@ function tripal_menu_alter(&$items) {
   // We don't want to allow deletion of fields added by the storage backend.
   // TODO: this shouldn't be hardcoded here.  These settings
   // should be part of the field and handled by the tripal_entity module.
-  $items['admin/structure/bio_data/manage/%TripalBundle/fields/%field_ui_menu/delete']['page callback'] = 'tripal_field_no_delete';
-  $items['admin/structure/bio_data/manage/%TripalBundle/fields/%field_ui_menu/delete']['page arguments'] = array();
+  //$items['admin/structure/bio_data/manage/%TripalBundle/fields/%field_ui_menu/delete']['page callback'] = 'tripal_field_no_delete';
+  //$items['admin/structure/bio_data/manage/%TripalBundle/fields/%field_ui_menu/delete']['page arguments'] = array();
 }
 
 

+ 6 - 3
tripal_chado/api/tripal_chado.schema.api.inc

@@ -40,10 +40,13 @@ function chado_table_exists($table) {
   global $databases;
   $default_db = $databases['default']['default']['database'];
   $cached_obj = cache_get('chado_tables', 'cache');
-  $cached_tables = $cached_obj->data;
-  if (is_array($cached_tables) and array_key_exists($table, $cached_tables)) {
-    return $cached_tables[$table]['exists'];
+  if ($cached_obj) {
+    $cached_tables = $cached_obj->data;
+    if (is_array($cached_tables) and array_key_exists($table, $cached_tables)) {
+      return $cached_tables[$table]['exists'];
+    }
   }
+
   $sql = "
     SELECT 1
     FROM information_schema.tables