From: Ian Fung <ianfunghk@459734.no-reply.drupal.org>
Date: Thu, 24 Sep 2015 00:49:14 +0800
Subject: [PATCH] Patched uuid display warning when new creating product with
 uuid token

---
 sites/all/modules/contrib/uuid/uuid.tokens.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sites/all/modules/contrib/uuid/uuid.tokens.inc b/sites/all/modules/contrib/uuid/uuid.tokens.inc
index 5b7a9d4..6f363f9 100644
--- a/sites/all/modules/contrib/uuid/uuid.tokens.inc
+++ b/sites/all/modules/contrib/uuid/uuid.tokens.inc
@@ -49,7 +49,7 @@ function uuid_tokens($token_type, $tokens, $data = array(), $options = array())
   $replacements = array();
   if ($token_type == 'entity') {
     $info = entity_get_info($data['entity_type']);
-    if (isset($info['uuid']) && $info['uuid'] == TRUE && !empty($info['entity keys']['uuid']) && !empty($tokens[$info['entity keys']['uuid']])) {
+    if (isset($info['uuid']) && $info['uuid'] == TRUE && !empty($info['entity keys']['uuid']) && !empty($tokens[$info['entity keys']['uuid']]) && isset($data['entity']->{$info['entity keys']['uuid']})) {
       $replacements[$tokens[$info['entity keys']['uuid']]] = $data['entity']->{$info['entity keys']['uuid']};
       if (!empty($info['entity keys']['revision uuid']) && !empty($tokens[$info['entity keys']['revision uuid']])) {
         $replacements[$tokens[$info['entity keys']['revision uuid']]] = $data['entity']->{$info['entity keys']['revision uuid']};
-- 
2.2.1

