From ce27819449a57e5dc3be232d25ab7ff5bf4b6e50 Mon Sep 17 00:00:00 2001
From: Tom Kirkpatrick <tom@systemseed.com>
Date: Tue, 25 Oct 2011 21:51:11 +0200
Subject: [PATCH 6/6] #1321028 - Fix for EntityMalformedException: Missing
 bundle property on entity of type node

---
 og_create_perms.module |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/og_create_perms.module b/og_create_perms.module
index 573cb35..e82cd53 100644
--- a/og_create_perms.module
+++ b/og_create_perms.module
@@ -46,8 +46,8 @@ function og_create_perms_field_attach_validate($entity_type, $entity, &$errors)
       // This may be as a result of field permissions
       // since we are not really bothered with any entity content apart from the group, 
       // we can safely replace it with old content (because, if the group is not here, it will not change)   
-      // reload the entity if we have to
-      $entity = og_load_entity($entity_type, $entity);
+      // NOTE: This currently relies on the Drupal 7 patch found at http://drupal.org/node/1220212#comment-4938924
+      $entity = $entity->original;
     } 
     $account = user_load($user->uid);
     
-- 
1.7.4.4

