Closed (fixed)
Project:
Universally Unique IDentifier
Version:
7.x-1.0-alpha3
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Apr 2012 at 02:19 UTC
Updated:
6 Jun 2012 at 16:42 UTC
When creating a content type, the following error will be output. The cause is that the variable $replacements is never instantiated.
Notice: Undefined variable: replacements in uuid_tokens() (line 103 of /drupal/sites/all/modules/uuid/uuid.tokens.inc)
The case statement has no default clause, which should be a default value for $replacement, or $replacement should be declared at the beginning then assigned values. An example of this is when type "entity" is created, is passed into this function, but sees no matching case statement. The value is never instantiated and is returned.
Code below is mostly removed, but presented for clarity to given an idea of the issue:
function uuid_tokens($type, $tokens, array $data = array(), array $options = array()) {
switch ($type) {
case 'node':
case 'user':
case 'file':
case 'term':
case 'comment':
}
return $replacements;
}
Comments
Comment #1
greg.1.anderson commentedLooks like this is already fixed in the dev version.
Comment #2
hexblot commentedif you came here from google looking for a quick fix -- just add the line
$replacements = array();as the first line of the function quoted above so that it readshope this helps someone out until it's rolled out on a normal release.
Comment #3
dixon_Yes, this is already fixed in the dev version. Thanks for noticing though :)
Comment #4
koppie commentedThank you to the devs for fixing it before I even realized there was a problem. :-)
Any word on when this will make it into a stable release?