--- includes/export.inc.orig	2009-08-08 13:54:49.906250000 +0200
+++ includes/export.inc	2009-08-08 18:55:27.484375000 +0200
@@ -230,43 +230,49 @@ function ctools_get_default_object($tabl
  * to get default objects.
  */
 function _ctools_export_get_defaults($table, $export) {
-  static $cache = array();
-
-  if (!isset($cache[$table])) {
+  // not use cached data if in admin/ directory
+  if (strpos($_GET['q'], 'admin/') !== FALSE) {
     $cache[$table] = array();
+  }
+  else {
+    // if not an admin path then load drupal cache
+    $cached_data = cache_get($table,'cache_ctools');
+    $cache[$table] = $cached_data->data;
+  }
 
-    if ($export['default hook']) {
-      if (!empty($export['api'])) {
-        ctools_include('plugins');
-        $info = ctools_plugin_api_include($export['api']['owner'], $export['api']['api'],
-          $export['api']['minimum_version'], $export['api']['current_version']);
-        $modules = array_keys($info);
-      }
-      else {
-        $modules = module_implements($export['default hook']);
-      }
+  // if there is not yet cached data then load it form default functions in modules
+  if (empty($cache[$table]) && $export['default hook']) {
+
+    if (!empty($export['api'])) {
+      ctools_include('plugins');
+      $info = ctools_plugin_api_include($export['api']['owner'], $export['api']['api'],
+        $export['api']['minimum_version'], $export['api']['current_version']);
+      $modules = array_keys($info);
+    }
+    else {
+      $modules = module_implements($export['default hook']);
+    }
 
-      foreach ($modules as $module) {
-        $function = $module . '_' . $export['default hook'];
-        if (function_exists($function)) {
-          if (empty($export['api'])) {
-            $cache[$table] += (array) $function($export);
-          }
-          else {
-            foreach ((array) $function($export) as $name => $object) {
-              // If version checking is enabled, ensure that the object can be used.
-              if (isset($object->api_version) &&
-                $object->api_version >= $export['api']['minimum_version'] &&
-                $object->api_version <= $export['api']['current_version']) {
-                $cache[$table][$name] = $object;
-              }
+    foreach ($modules as $module) {
+      $function = $module . '_' . $export['default hook'];
+      if (function_exists($function)) {
+        if (empty($export['api'])) {
+          $cache[$table] += (array) $function($export);
+        }
+        else {
+          foreach ((array) $function($export) as $name => $object) {
+            // If version checking is enabled, ensure that the object can be used.
+            if (isset($object->api_version) &&
+              $object->api_version >= $export['api']['minimum_version'] &&
+              $object->api_version <= $export['api']['current_version']) {
+              $cache[$table][$name] = $object;
             }
           }
         }
       }
-
-      drupal_alter($export['default hook'], $cache[$table]);
     }
+    cache_set($table, $cache[$table], 'cache_ctools', CACHE_TEMPORARY);
+    drupal_alter($export['default hook'], $cache[$table]);
   }
 
   return $cache[$table];
