It's probably a little early, but please consider including support for tokens as per the Token module.

One immediate use for me is to use it as a URL alias for resources.

Comments

Arto’s picture

This is a great idea as it would make it very easy to have nodes use %uuid as their URL alias pattern in the Pathauto module.

recidive’s picture

I support this.

Could you guys work on a patch?

Thanks!

ilo’s picture

Status: Active » Needs review
StatusFileSize
new1.83 KB

So, redicive, first impressions..

I'm using this patch right now in a live site as a test generating automatic node titles using pathauto and looks like it is working perfectly. I don't find a way to insert the taxonomy and comment tokens for now, so I'm uploading as is to get the feeling and start discussing ideas about additional tokens that should be provided by the module.

ilo’s picture

Status: Needs review » Needs work

And actually it was failing because I forgot to verify the author-uuid token. There is a $node in this patch that should be $object. Will fix in the next patch with taxonomy and comment tokens included.

ilo’s picture

Status: Needs work » Needs review
StatusFileSize
new2.19 KB

An updated version of the patch including the fix and a global uuid token. This is the list of current implemented tokens:

Global:
- uuid: an arbitrary uuid generated on demand not linked with any object.

Node:
- uuid: the node's uuid.
- revision-uuid: the node revision's uuid
- author-uuid: the node author's uuid

User:
- uuid: the user's uuid.

The simpletest patch at #927778: Complete simpletest testcases for taxonomy and comments is including also testcases for the token support.

Taxonomy and comment are not yet implemented, nor tested.

recidive’s picture

Status: Needs review » Fixed

I did some small code style changes and committed the patch. Thanks!

recidive’s picture

Status: Fixed » Needs work

Although we have a handful of tokens to work with, I'm going to move the issue to "needs work" until we have added all possible tokens.

ilo’s picture

Did you revert the commit or should be update readme.txt with the included tokens up to now? I'd accept suggestions about taxonomy and comment tokens, I didn't put these in the patch because I have no idea what tokens will be usefull.

Any advice?

anon’s picture

Is this feature included in the 7.x version? I cant find it.

anon’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs work » Needs review
StatusFileSize
new2.75 KB

Here is a patch for Drupal7.

Adds uuid tokens for:

  • nodes
  • users
  • terms
  • files
  • comments
dixon_’s picture

Status: Needs review » Fixed

Thanks everyone for working on this. This is finally committed to 7.x-1.x-dev and and will be in the release I'm rolling right now.

Status: Fixed » Closed (fixed)

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

eiland’s picture

Version: 7.x-1.x-dev » 6.x-1.0-beta2
Status: Closed (fixed) » Active

Patch at #5 applies to 6.x-1.0-beta2 but

It reports user warning: Duplicate entry '' for key 'uuid_node_revisions_uuid_key' query: INSERT INTO uuid_node_revisions (vid, uuid, nid) VALUES (16, '', 11) in /root/sites/all/modules/uuid/uuid.module on line 105.

And when bulk generating UUID nodes at /admin/settings/uuid I get a bunch of

warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in /root/includes/database.mysqli.inc on line 329.
skwashd’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Drupal 6 core is no longer supported. We are no longer supporting 6.x-1.x versions of this module. I am closing this issue as won't fix.