I updated the new Alpha3 version. The update process crash, and since then I got around 10 error messages per minute with the same message:
Notice: Undefined variable: replacements in uuid_tokens() (line 95 of /home/ecodev/public_html/sites/all/modules/uuid/uuid.tokens.inc)

On top of this I get also 2 more messages which repeat every few minutes:

  1. Notice: Undefined index: version_major in update_calculate_project_update_status() (line 556 of /home/ecodev/public_html/modules/update/update.compare.inc).
  2. Notice: Undefined index: value in theme_status_report() (line 2552 of /home/ecodev/public_html/modules/system/system.admin.inc).

Comments

dixon_’s picture

Title: Update crash after installing new version + Multiple error messages on going » Rewrite token integration to be more entity generic
Assigned: Unassigned » dixon_
Status: Active » Needs work

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() and theme_status_report() doesn't seem to be related to UUID.

shaisamuel’s picture

Thank, 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?

robcarr’s picture

I'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)

socialnicheguru’s picture

i 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).

luchoh’s picture

subscribing

gpmaker’s picture

I'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)"

emptyvoid’s picture

StatusFileSize
new294 bytes

This 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.

emptyvoid’s picture

Assigned: dixon_ » Unassigned
Status: Needs work » Needs review

Changing status for patch.

Dixon don't assign an issue unless you intend to fix the and or are the maintainers for the module.

Status: Needs review » Needs work

The last submitted patch, 02022012-uuid-uuid_tokens.patch, failed testing.

shaisamuel’s picture

Thanks, 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?

emptyvoid’s picture

StatusFileSize
new554 bytes

Sigh, bad patch let's try this one.

emptyvoid’s picture

Status: Needs work » Needs review

Changing so the patch will get evaluated.

Status: Needs review » Needs work

The last submitted patch, uuid-uuid_token-1423542-7.patch, failed testing.

emptyvoid’s picture

Status: Needs work » Needs review

This is ridiculous, just add this ($replacements = array();) on to line 48 of uuid.tokens.inc


47: function uuid_tokens($type, $tokens, array $data = array(), array $options = array()) {
48:   $replacements = array();
49:   switch ($type) {
50:     case 'node':
51:       $node = $data['node'];

emptyvoid’s picture

[[Facepalm]] I just realized Dixon is the maintainer.. sorry Dixon.. (sigh)

shaisamuel’s picture

Thanks emptyvoid, I apply the change @14 and since I dont have this message anymore.

Hopefully, this will be implemented as a patch.

dixon_’s picture

Assigned: Unassigned » dixon_
Status: Needs review » Fixed

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.

David4514’s picture

I'm assuming that #17 refers to the following commit:

Universally Unique IDentifier: February 3, 2012 19:15

Commit c2bb832 on 7.x-1.x
by dixon_
 Rewrote the Token support to be more generic and support all UUID entity types.

After that commit I am now getting the following messages whenever I attempt to edit content.

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).

In lines 38 and 40 of uuid.tokens.inc, $tokens has no uuid or vuuid index values.

David4514’s picture

Adding to #18, I have attached images of the local variables and call stack at the time uuid_tokens(...) is executed.

ergophobe’s picture

Same error here on latest dev release

Actually - only getting the uuid problem (line 38), but I've only tried editing taxonomy so far.

atlea’s picture

Version: 7.x-1.0-alpha3 » 7.x-1.x-dev
Status: Fixed » Needs work

Same errors as #18 on latest dev. Two notices in the log for every page view, not just edits..

3rdLOF’s picture

Errors still kicking around.

iGong’s picture

Same 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).

David4514’s picture

StatusFileSize
new1012 bytes

I'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?

iGong’s picture

Seems to work for me! Thanks a lot...

3rdLOF’s picture

#24 seems to be working for me as well.

macmladen’s picture

While #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

    Warning: explode() expects parameter 2 to be string, array given in menu_node_submit() (line 723 of /home/spirid/tempus.dx.rs/modules/menu/menu.module).
    PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'menu_name' cannot be null: INSERT INTO {menu_links} (menu_name, plid, link_path, hidden, external, has_children, expanded, weight, module, link_title, options, customized, updated) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => 0 [:db_insert_placeholder_2] => node/107 [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => 0 [:db_insert_placeholder_6] => 0 [:db_insert_placeholder_7] => 0 [:db_insert_placeholder_8] => menu [:db_insert_placeholder_9] => Tempus projekat [:db_insert_placeholder_10] => a:0:{} [:db_insert_placeholder_11] => 0 [:db_insert_placeholder_12] => 0 ) in menu_link_save() (line 3109 of /home/spirid/tempus.dx.rs/includes/menu.inc).
atlea’s picture

#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?

yuriy.babenko’s picture

StatusFileSize
new1012 bytes

Updated 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?

acrollet’s picture

Status: Needs work » Reviewed & tested by the community

Patch in #29 eliminates the 'Undefined variable: replacements in uuid_tokens()' errors.

jzornig’s picture

Patch #29 works for me.

gmclelland’s picture

Patch in #29 fixed my errors:

Notice: Undefined index: uuid in uuid_tokens() (line 38 of /***/modules/uuid/uuid.tokens.inc).
Notice: Undefined index: vuuid in uuid_tokens() (line 40 of /***/modules/uuid/uuid.tokens.inc).
dixon_’s picture

Status: Reviewed & tested by the community » Fixed

Thanks everyone for the work on this! Much appreciated.

Committed patch from #29 to 7.x-1.x.

mfby2k’s picture

Thanks @emptyvoid #14 fixed my notice problem

sarjeet.singh’s picture

I 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.

acrollet’s picture

sarjeet.singh - you need to download the latest dev snapshot, and report only if it does not fix the problem.

sarjeet.singh’s picture

Status: Fixed » Active

acrollet - 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).

duaelfr’s picture

@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

if (isset($info['uuid']) && $info['uuid'] == TRUE && isset($tokens[$info['entity keys']['uuid']]) && !empty($info['entity keys']['uuid'])) {

Instead of

if (isset($info['uuid']) && $info['uuid'] == TRUE && !empty($info['entity keys']['uuid']) && !empty($tokens[$info['entity keys']['uuid']])) {

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

beanworks’s picture

Just 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

duaelfr’s picture

Status: Active » Needs review

I 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.

gmclelland’s picture

See #33 - It's committed in the 1.x-dev version

dixon_’s picture

Status: Needs review » Fixed

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.

kenwest’s picture

Status: Fixed » Needs review

#11: uuid-uuid_token-1423542-7.patch queued for re-testing.

mh86’s picture

Status: Needs review » Needs work

Receiving following notice on my website:

Notice: Undefined index: token type in uuid_token_info() - line 16 in uuid.tokens.inc
dixon_’s picture

@mh86 Can you make sure that you are running the latest dev version? I though we fixed this...

dixon_’s picture

I can actually confirm the PHP notice mentioned in #44. I'll fix this.

dixon_’s picture

Status: Needs work » Fixed

Fixed. Thanks for the notice!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

yeila’s picture

@ comment #14 perfect. thank you.

mayiaba’s picture

comment #14 works! Thanks emptyvoid

shane birley’s picture

@emptyvoid suggestion in #14 appears to fix the problem.

chrisjlee’s picture

I 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

pfrenssen’s picture