Closed (fixed)
Project:
Universally Unique IDentifier
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
31 Jan 2012 at 22:59 UTC
Updated:
21 Mar 2013 at 15:19 UTC
Jump to comment: Most recent file
Comments
Comment #1
dixon_I see the problem, regarding the UUID token integration. I was too quick committing the token patch that was provided. I'm gonna revisit the token integration to be more generic, and fix the problem at the same time. Hopefully I can release this in a new version soon.
However, the error messages regarding
update_calculate_project_update_status()andtheme_status_report()doesn't seem to be related to UUID.Comment #2
shaisamuel commentedThank, I am looking forward, since I am stuck now with alpha3. If you can't do it in the next day or 2, can you please restore the last working version?
Comment #3
robcarrI'm only seeing it on Node pages where I've overridden the page template with Panels/Page Manager.
However, reverting to alpha2 for the meantime...
(*EDIT* meant to state I'm only getting the 'Notice: Undefined variable: replacements in uuid_tokens() (line 95 of uuid.tokens.inc).' error)
Comment #4
socialnicheguru commentedi am getting the error on the front page and other pages intermittently
Notice: Undefined variable: replacements in uuid_tokens() (line 95 of /var/aegir/platforms/7/modules/all/uuid/uuid.tokens.inc).
Comment #5
luchoh commentedsubscribing
Comment #6
gpmaker commentedI'm trying deploy content with the deploy module. After run cron I see error message "The website encountered an unexpected error. Please try again later."
and in the "Recent log messages" I see many messages "Notice: Undefined variable: replacements in uuid_tokens() (line 95 of /home/ecodev/public_html/sites/all/modules/uuid/uuid.tokens.inc)"
Comment #7
emptyvoid commentedThis issue is the hook method tries to return a variable but it is never declared, if none of the entity targets evaluate.
Patch applied to add the declaration for the property.
Comment #8
emptyvoid commentedChanging status for patch.
Dixon don't assign an issue unless you intend to fix the and or are the maintainers for the module.
Comment #10
shaisamuel commentedThanks, but this patch looks really different from any patch I have seen until today. Can you try and create one which will fit the standard patch?
Comment #11
emptyvoid commentedSigh, bad patch let's try this one.
Comment #12
emptyvoid commentedChanging so the patch will get evaluated.
Comment #14
emptyvoid commentedThis is ridiculous, just add this ($replacements = array();) on to line 48 of uuid.tokens.inc
Comment #15
emptyvoid commented[[Facepalm]] I just realized Dixon is the maintainer.. sorry Dixon.. (sigh)
Comment #16
shaisamuel commentedThanks emptyvoid, I apply the change @14 and since I dont have this message anymore.
Hopefully, this will be implemented as a patch.
Comment #17
dixon_I've rewritten the Token support to be more generic and support all entities, even those declared by other modules that support UUIDs. It's committed to 7.x-1.x. So please give the new integration a ride.
If I don't find any immediate problems, I'll probably gonna roll a new alpha release today.
Comment #18
David4514 commentedI'm assuming that #17 refers to the following commit:
After that commit I am now getting the following messages whenever I attempt to edit content.
In lines 38 and 40 of uuid.tokens.inc, $tokens has no uuid or vuuid index values.
Comment #19
David4514 commentedAdding to #18, I have attached images of the local variables and call stack at the time uuid_tokens(...) is executed.
Comment #20
ergophobe commentedSame error here on latest dev release
Actually - only getting the uuid problem (line 38), but I've only tried editing taxonomy so far.
Comment #21
atlea commentedSame errors as #18 on latest dev. Two notices in the log for every page view, not just edits..
Comment #22
3rdLOF commentedErrors still kicking around.
Comment #23
iGong commentedSame here:
Notice: Undefined index: uuid in uuid_tokens() (line 38 of /www/htdocs/nnn/sites/all/modules/uuid/uuid.tokens.inc).
Notice: Undefined index: vuuid in uuid_tokens() (line 40 of /www/htdocs/nnn/sites/all/modules/uuid/uuid.tokens.inc).
Comment #24
David4514 commentedI'll look to some experts for confirmation. But I believe that the hook_token function is called whenever token_replace has been called. However, the tokens needing to be replaced will not always contain uuid or vuuid (or any other possible token from the UUID module). The latest change to the uuid_tokens function in uuid.tokens.inc assumes that the "uuid" or "vuuid" keys will always exist in the $tokens parameter of the function. This is not true, and is what is causing the error messages.
If it should always be true, that is another issue. But I don't think that is the case. In my case, pathauto has called token_replace and the only token key in $tokens is "title".
There may be a more efficient way to test whether or not the uuid_tokens should immediately return, but the patch that I have attached adds tests to see if the desired $token key even exists before it attempts to provide a replacement.
It has stopped the error messages. The question is have I introduced any other problems as a result?
Comment #25
iGong commentedSeems to work for me! Thanks a lot...
Comment #26
3rdLOF commented#24 seems to be working for me as well.
Comment #27
macmladen commentedWhile #24 patch didn't work for me (on 7.x-1.x-dev from 02.04.2012 with
patch -p0 < test_if_replacement_requested-1423542-24.patch) I did manage to apply the change manualy.And while edit error did go out, I still get error on submit
Comment #28
atlea commented#24: isset() tests should go before empty(), other than that the patch looks right by me.
#27: That error looks unrelated. As for the patch, did you try -p1?
Comment #29
yuriy.babenko commentedUpdated patch in #24 to do isset() checks before empty() checks; done against 7.x-1.x-dev from 02.04.2012.
@MacMladen - not getting any errors during submit on my end. Possible that your error is caused by something else?
Comment #30
acrollet commentedPatch in #29 eliminates the 'Undefined variable: replacements in uuid_tokens()' errors.
Comment #31
jzornig commentedPatch #29 works for me.
Comment #32
gmclelland commentedPatch in #29 fixed my errors:
Comment #33
dixon_Thanks everyone for the work on this! Much appreciated.
Committed patch from #29 to 7.x-1.x.
Comment #34
mfby2k commentedThanks @emptyvoid #14 fixed my notice problem
Comment #35
sarjeet.singh commentedI am getting the same error after submit node form.
Notice: Undefined variable: replacements in uuid_tokens() (line 95 of /var/aegir/platforms/7/modules/all/uuid/uuid.tokens.inc).
I am using 7.x-1.0-alpha3 version.
Comment #36
acrollet commentedsarjeet.singh - you need to download the latest dev snapshot, and report only if it does not fix the problem.
Comment #37
sarjeet.singh commentedacrollet - now i am using dev version (7.x-1.0-alpha3+8-dev).
I am getting same issue.
Notice: Undefined variable: replacements in uuid_tokens() (line 95 of /var/aegir/platforms/7/modules/all/uuid/uuid.tokens.inc).
Comment #38
duaelfr@sarjeet.singh : There are only 46 lines in this file so you may check it is not a conflict from you versionning system.
---
@all :
I made a self review of this file because I was having same notices as #32 and I found a very very tiny issue highly depending on PHP version.
You wrote
Instead of
As PHP is reading boolean statements from left to right you might inverse your last two conditions to avoid testing if there is an empty key in the $tokens array.
Moreover, you may replace the "isset" function by a "!empty" one unless you want token to replace empty string ;)
Here is a small patch
Comment #39
beanworks commentedJust to clarify where things are now, what would be the way to fix this? Download the dev version, or apply the patches (and which one(s) in which order)?
Thanks
Comment #40
duaelfrI would love to be one of the maintainers of this great module but I am not so until one of them say it is commited, you will have to apply the patch. Mine (#28) is currently applied on 3 different projects and seems to work well.
Comment #41
gmclelland commentedSee #33 - It's committed in the 1.x-dev version
Comment #42
dixon_The problems still seems to be there, and the changes introduced in #38 by DuaelFr makes perfect sense. So I've committed that. So that should finally fix this.
Thanks everyone.
Comment #43
kenwest commented#11: uuid-uuid_token-1423542-7.patch queued for re-testing.
Comment #44
mh86 commentedReceiving following notice on my website:
Comment #45
dixon_@mh86 Can you make sure that you are running the latest dev version? I though we fixed this...
Comment #46
dixon_I can actually confirm the PHP notice mentioned in #44. I'll fix this.
Comment #47
dixon_Fixed. Thanks for the notice!
Comment #52
yeila commented@ comment #14 perfect. thank you.
Comment #56
mayiaba commentedcomment #14 works! Thanks emptyvoid
Comment #59
shane birley commented@emptyvoid suggestion in #14 appears to fix the problem.
Comment #60
chrisjlee commentedI used #14 and it fixed my problem. Now it's giving me an error for the node:
Undefined index: node in uuid_tokens():
notice: Undefined index: node in uuid_tokens() (line 52 of /xxx/sites/all/modules/uuid/uuid.tokens.inc).
Notice: Undefined index: node in uuid_tokens() (line 53 of /home/xxx/rb/sites/all/modules/uuid/uuid.tokens.inc).
i recommend rewriting the function so it checks for the array key. I'll write a patch later
Comment #61
pfrenssenMarked #1810226: Error message when deploying a site: Undefined variable: $replacements as a duplicate of this issue.