? ctools_var_export_stdclass.patch
Index: includes/export.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/includes/export.inc,v
retrieving revision 1.19.2.2
diff -u -p -r1.19.2.2 export.inc
--- includes/export.inc	8 Oct 2009 16:12:17 -0000	1.19.2.2
+++ includes/export.inc	16 Dec 2009 15:37:01 -0000
@@ -390,6 +390,13 @@ function ctools_var_export($var, $prefix
       $output .= ')';
     }
   }
+  else if (is_object($var) && get_class($var) === 'stdClass') {
+    // var_export() will export stdClass objects using an undefined
+    // magic method __set_state() leaving the export broken. This
+    // workaround avoids this by casting the object as an array for
+    // export and casting it back to an object when evaluated.
+    $output .= '(object) ' . ctools_var_export((array) $var);
+  }
   else if (is_bool($var)) {
     $output = $var ? 'TRUE' : 'FALSE';
   }
