Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bryanhirsch/1974649 to your computer and use it in GitHub Desktop.
Save bryanhirsch/1974649 to your computer and use it in GitHub Desktop.
Prevent undefined index warning. Note: This section is rewritten in the dev branch of uuid. So this patch shouldn't be necessary after 7.x-1.0-alpha3.
diff --git a/uuid.tokens.inc b/uuid.tokens.inc
index d1ec58e..8042e3a 100644
--- a/uuid.tokens.inc
+++ b/uuid.tokens.inc
@@ -92,5 +92,9 @@ function uuid_tokens($type, $tokens, array $data = array(), array $options = arr
break;
}
+ // Prevent undefined index warning. Note: This section is rewritten in the dev branch
+ // of uuid. So this patch shouldn't be necessary after 7.x-1.0-alpha3.
+ $replacements = (empty($replacements)) ? array() : $replacements;
+
return $replacements;
-}
\ No newline at end of file
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment