From c027bfcb606992833e7b63bf629258e0604d876c Mon Sep 17 00:00:00 2001
From: Juampy <juampy72@gmail.com>
Date: Fri, 26 Jul 2013 18:09:47 +0200
Subject: [PATCH] Issue #1359472 by indytechcook | mikewink | juampy: Fixed
 Error while uninstalling bean.

---
 bean.install | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/bean.install b/bean.install
index 1bb2d90..2f67d9b 100644
--- a/bean.install
+++ b/bean.install
@@ -210,7 +210,9 @@ function bean_schema() {
  */
 function bean_uninstall() {
   // Make sure bean.module is include.
-  require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'bean.module';
+  if (!function_exists(bean_get_types)) {
+    require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'bean.module';
+  }
   // Bypass entity_load() as we cannot use it here.
   foreach (bean_get_types() as $bean_type) {
     field_attach_delete_bundle('bean', $bean_type->type);
-- 
1.8.1.2

