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.

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


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
910 bytes
PASSED: [[SimpleTest]]: [MySQL] 73 pass(es). View

Made a patch that implements hook_token_info_alter(). I couldn't see how or when 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, and committed to 7.x-2.x. Thanks!

Status: Fixed » Closed (fixed)

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