Hi,

I use the FILEFIELD MODULE that create a TOKEN with the url of the file atached to a node. (new node is send by email with RULE MODULE)

When there is no file attached to a new node, the token is visible. For example, [FIELD_FILE_EXAMPLE_CCK].

Is it possible to hide the token when it is empty ?

In a first time I have published this bug in the issues of the token module; but the developers tell me that it's the filefield path module that must be modified :

"The 6.x-1.x code has supported calling code using the $options['clear'] = TRUE parameter to remove un-replaced tokens."

Can you help me ?

Thanks.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pillarsdotnet’s picture

Version: 6.x-1.4 » 6.x-2.x-dev
FileSize
1.14 KB

The 6.x-1.x branch of the Filefield Paths module does not call the token_replace() function.

The 6.x-2.x branch does call token_replace, however.

patch attached.

vstmusic’s picture

Must I first download and install the 6.x-2.x branch before to apply your patch ? Or can I apply the patch on the 6.1.4 version of the module ?

If so, I don't see the 6.x.-2.x version of the module on the module page.

thanks for your help.

pillarsdotnet’s picture

Status: Active » Needs review

The 6.x-1.x version does not call token_replace() so cannot fix your problem.

It is possible that the 6.x-2.x version will not fix your problem, either. But if you want to try it, here is a download link:

http://drupalcode.org/project/filefield_paths.git/snapshot/refs/heads/6....

ajacksontcba’s picture

You can try using the token_custom module and define a token that returns an empty string if no file is attached.

hass’s picture

Status: Needs review » Reviewed & tested by the community

Codewise correct.

Deciphered’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Closed (won't fix)

While I did want to review and consider committing this, I have made the decision that there will be no further D6 development, at least by myself. Sorry.