Please use entity tokens instead of just node tokens.
FileField Paths code:

      $entity_info = entity_get_info($form['#instance']['entity_type']);

      // Replacement patterns for field.
      $field_data['form_path']['token_tree'] = array(
        '#type' => 'fieldset',
        '#title' => t('Replacement patterns'),
        '#collapsible' => TRUE,
        '#collapsed' => TRUE,
        '#description' => theme('token_tree', array('token_types' => array('file', $entity_info['token type']))),
        '#weight' => 10,
      );
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

13rac1’s picture

Category: bug » feature

I'll look into this soon. Thanks

13rac1’s picture

Project: » ImageField Tokens
Version: » 7.x-1.x-dev
Assigned: Unassigned » 13rac1

Code has moved to ImageField Tokens 7.x, moving issues also.

quotesBro’s picture

Priority: Normal » Major
Issue summary: View changes

Any progress on this issue?

quotesBro’s picture

Assigned: 13rac1 » Unassigned
Status: Active » Needs review
FileSize
3.66 KB

Marked #1937040: Taxonomy term tokens are not provided as duplicate of this issue.

Please test attached patch.

I think we also need to add dependencies on Token and Entity modules in imagefield_tokens.info:

dependencies[] = token
dependencies[] = entity

and then remove calls of module_exists().
But I think it should be done in another issue.

Anybody’s picture

Looks and works great. Any further progress on this?

interdruper’s picture

Status: Needs review » Reviewed & tested by the community

#4 works great for me.

Anybody’s picture

@Module maintainer: Could you add this to the dev version?

yogaf’s picture

Title: Use entity tokens » Use entity tokens RTBC

Yep, It's working.
@Deciphered Please commit - limit tokens just to nodes is not really an option these days.
Thanks.

maximpodorov’s picture

Thanks for the patch!

jidrone’s picture

I used the patch on commerce products and it works perfect.

cosolom’s picture

It works for me. Thanks!

kthull’s picture

Thanks for the patch! Worked perfectly for auto-filling the product title in the image field.

yogaf’s picture

Title: Use entity tokens RTBC » Use entity tokens RTBC Please!!!
colan’s picture

Title: Use entity tokens RTBC Please!!! » Use entity tokens

Please stop overloading titles to get maintainers' attention. The only effect this has is to spam everyone watching the issue. Instead, use their contact forms to e-mail them if they don't respond in a desired amount of time.

Chris Matthews’s picture

The patch in #4 to imagefield_tokens.module still applies to the latest 7.x-1.x-dev and also works for me, which brings the total number of tests/reviews to 8.

ysamoylenko’s picture

Issue tags: +epam-contrib-2019.03
ysamoylenko’s picture

Tested with ECK entities.
It works.
The patch will be committed in a short time.

ysamoylenko’s picture

Status: Reviewed & tested by the community » Fixed

The patch was committed. Thank all for your participation.

ram4nd’s picture

Issue tags: -epam-contrib-2019.03

Status: Fixed » Closed (fixed)

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