system.tokens.inc implements [file:name] which overrides the existing file name. The description remains from the core token: "The name of the file on disk."

I doubt this module wants to replace this core token, even though the new value is arguably better it should probably use another token.

Discovered this while working on a patch which needs the File Entity name value (rather than the actual filename as it is on disk). So it works, but this should probably change unless there are motivations here I'm not seeing.

Files: 
CommentFileSizeAuthor
#2 token_file_name_description_alter-1553020-2.patch910 byteslawik
PASSED: [[SimpleTest]]: [MySQL] 73 pass(es).
[ View ]

Comments

Category:bug» task

This is actually something that token.module already kinda handle because it provides a [file:basename] token which the *actual* base name of the file from $file->uri. In the file_entity module we should use hook_token_info_alter() to change the description of the [file:name] token to match what it actually is.

Status:Active» Needs review
StatusFileSize
new910 bytes
PASSED: [[SimpleTest]]: [MySQL] 73 pass(es).
[ View ]

Made a patch that implements hook_token_info_alter(). I couldn't see how or when file_entity.tokens.inc was included (all ears for how that happens) so I ended up in file_entity.module.

Status:Needs review» Fixed

I modified this a bit, moved it to file_entity.tokens.inc, and committed to 7.x-2.x. Thanks!
http://drupalcode.org/project/file_entity.git/commit/06c8895

Status:Fixed» Closed (fixed)

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