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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

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.

lawik’s picture

Status: Active » Needs review
FileSize
910 bytes

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.

Dave Reid’s picture

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.