After installing alpha3 release, any attempt to edit any content results in the following message.
Notice: Undefined variable: replacements in uuid_tokens() (line 95 of ...sites\all\modules\uuid\uuid.tokens.inc).
In the newly updated uuid_tokens function in uuid.tokens.inc, if the $type is not one of the values in the switch block (node, user, file, term, or comment), an attempt is made to return $replacements. However, the $type is 'entity' which does not match any of the values in the switch block. The $replacements variable is undefined and the return fails.
Probably the $replacements variable should be defined as an empty array prior to the switch block. I do find it odd that no test is made for a $type of entity.
I see that this function has been replaced since alpha3. The newly written function available in the dev version as of 2/4/2012 also fails, but with different messages.
Notice: Undefined index: uuid in uuid_tokens() (line 38 of ...sites/all/modules/uuid/uuid.tokens.inc).
Notice: Undefined index: vuuid in uuid_tokens() (line 40 of .../sites/all/modules/uuid/uuid.tokens.inc).
Comment | File | Size | Author |
---|---|---|---|
#22 | uuid.token_.inc-undefined-replacements.patch | 433 bytes | timaholt |
Comments
Comment #1
3rdLOF CreditAttribution: 3rdLOF commentedExact same problem with identical errors on the content edit page.
Comment #2
jzornig CreditAttribution: jzornig commentedsubscribe
Comment #3
cpelham CreditAttribution: cpelham commentedI'm getting the same error.
Comment #4
dixon_This is a duplicate of #1423542: Rewrite token integration to be more entity generic and fixed in 7.x-1.x-dev already.
Comment #5
dixon_Comment #6
Torenware CreditAttribution: Torenware commentedFixed, but is there a released version that has the fix? Or do you recommend the dev build for this?
Comment #7
heckad CreditAttribution: heckad commentedsame problem any fix?
Comment #8
trangunghoa CreditAttribution: trangunghoa commentedI fixed this error by:
add line "$replacements = array();" in head function uuid_tokens
"
function uuid_tokens($type, $tokens, array $data = array(), array $options = array()) {
+ $replacements = array();
switch ($type) {
"
Comment #9
bagpiper CreditAttribution: bagpiper commentedThank you, that did the trick Trangunghoa. Hope we get the beta release for UUID soon :-)
Comment #10
flashwebcenterThank you trangunghoa for your help.
Comment #11
yannickooSaw this in the dev release so it's fixed.
Comment #12
csander CreditAttribution: csander commentedAwesome, thanks for the fix!
Comment #13
Citlalli CreditAttribution: Citlalli commentedwhere add the line it??
Comment #14
jmonroe CreditAttribution: jmonroe commentedThanks...this fixed my error too.
Comment #15
jmonroe CreditAttribution: jmonroe commented@Citlalli - You need to add it under line 95 of /sites/all/modules/uuid/uuid.tokens.inc
So line 95-97 looks as below
function uuid_tokens($type, $tokens, array $data = array(), array $options = array()) {
+ $replacments = array();
switch ($type) {
That will fix it for you.
Comment #16
Citlalli CreditAttribution: Citlalli commentedi put it, it isnt working :S, I am using local server, may be is for that isnt?
Comment #17
luistope CreditAttribution: luistope commentedIt works for me!
@Citlalli be careful with the copy paste. + $replacments = array(); is + $replacements An 'e' misses in jmonroe solution. ;)
Comment #18
kyke01 CreditAttribution: kyke01 commentedIt's works for me too but without the + sign ,
just add $replacements = array(); to the function
Comment #19
Myoos CreditAttribution: Myoos commentedtrangunghoa : thank u soo much this was help full =)
Comment #20
Seb36 CreditAttribution: Seb36 commentedthanks trangunghoa
kyke01 Lines beginning with "+" are added (without the "+", of course).
http://drupal.org/node/534548
Comment #21
gregmarsh CreditAttribution: gregmarsh commentedJust wanted to say thank you for this ... very simple and quick fix.
All the best.
Comment #22
timaholt CreditAttribution: timaholt commentedFor anyone using drush make and the alpha3 release, here's a patch for this issue.
Comment #23
roborracle CreditAttribution: roborracle commented#22 patch worked for me
Comment #24
shrop CreditAttribution: shrop commentedPatch #22 worked for me also. Thanks!
Comment #25
kyleoliveira CreditAttribution: kyleoliveira commented#15 seems to have fixed the issue for me. I would definitely suggest adding it in the next release.
Comment #26
Exploratus CreditAttribution: Exploratus commented22 Worked for me.
Thanks. Should commit this no?
Comment #27
Offlein CreditAttribution: Offlein commentedThis probably won't get fixed because the status was closed.
Please put #22 in.
Comment #29
skwashd CreditAttribution: skwashd commentedThis issue has previously been closed as a duplicate of #1423542: Rewrite token integration to be more entity generic. I am closing it again.
Comment #30
windmaomao CreditAttribution: windmaomao commentedso what is the issue to not commit this simple change to the repository ? Can someone explain why this line is not considered a good commit ? thanks. I'm puzzled, since everytime i do a drush dl uuid, i have to come back add this fix.
Comment #31
Offlein CreditAttribution: Offlein commentedI'm sorry, I hadn't followed this properly, but I suspect, windmaomao, that you're not using Drush will only download the -alpha3 version, not the -dev version, and hence you're not dl'ing the latest code?
If you ARE, try submitting a new ticket.
Comment #32
timaholt CreditAttribution: timaholt commentedNot sure why the patch failed testing as it patches correctly for me manually and using drush make. Any ideas?
Comment #33
chrisjlee CreditAttribution: chrisjlee commented#22: uuid.token_.inc-undefined-replacements.patch queued for re-testing.
Comment #35
chrisjlee CreditAttribution: chrisjlee commentedI just updated to the dev release and it seems to have disappeared.
Comment #36
ascii122 CreditAttribution: ascii122 commentedThe latest 7.x-1.0-alpha3 version has a typo: File: uuid.tokens.inc Line 48
$replacments = array();
should be
$replacements = array();
Comment #37
pfrenssenThis has not been fixed here but in #1423542: Rewrite token integration to be more entity generic, marking this as a duplicate of that issue.
Comment #38
dgamache CreditAttribution: dgamache commented$replacements = array();
Patch is not working for me.
drupal core 7.21
Open Enterprise Profile
Universally Unique ID 7.x-1.0
Comment #39
kwfinken CreditAttribution: kwfinken commented#22: uuid.token_.inc-undefined-replacements.patch queued for re-testing.
Comment #41
pfrenssenNo need to test the patch or reopen this issue. This has long been fixed in the development version. Don't use the 7.x-1.0-alpha3, it is over a year old. Use 7.x-1.x-dev.
Marking this as a duplicate of #1423542: Rewrite token integration to be more entity generic, this is the issue in which this problem was fixed.
Comment #44
pfrenssenNo need to test the patch, this issue has already been fixed over 2 years ago in #1423542: Rewrite token integration to be more entity generic.