From 1e0adc43b5b801cdeb84ca4a5e52c1e4d925150b Mon Sep 17 00:00:00 2001
From: Jeff Amaral <jeff@freethoughtdesign.com>
Date: Thu, 21 Feb 2013 11:02:38 -0500
Subject: [PATCH] Rehashes blocks table on bean save

block_flush_caches() used to be called in the save method
of the Bean class, but was removed in rc7. It's still needed,
though, since its removal breaks the functionality of the
blockreference module (and possibly others).
---
 includes/bean.core.inc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/includes/bean.core.inc b/includes/bean.core.inc
index 5c5432e..c2ac861 100644
--- a/includes/bean.core.inc
+++ b/includes/bean.core.inc
@@ -348,6 +348,10 @@ class Bean extends Entity {
     $return = parent::save();
     bean_reset();
 
+    // Rehashes blocks for active themes. This will populate the blocks table and allow
+    // modules like blockreference to work properly.
+    block_flush_caches();
+
     return $return;
   }
 
-- 
1.8.1.1

