Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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,
);
Comment | File | Size | Author |
---|---|---|---|
#4 | imagefield_tokens-entity_tokens-1340798-4.patch | 3.66 KB | quotesBro |
Comments
Comment #1
13rac1 CreditAttribution: 13rac1 commentedI'll look into this soon. Thanks
Comment #2
13rac1 CreditAttribution: 13rac1 commentedCode has moved to ImageField Tokens 7.x, moving issues also.
Comment #3
quotesBro CreditAttribution: quotesBro commentedAny progress on this issue?
Comment #4
quotesBro CreditAttribution: quotesBro commentedMarked #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:
and then remove calls of module_exists().
But I think it should be done in another issue.
Comment #5
AnybodyLooks and works great. Any further progress on this?
Comment #6
interdruper CreditAttribution: interdruper commented#4 works great for me.
Comment #7
Anybody@Module maintainer: Could you add this to the dev version?
Comment #8
yogaf CreditAttribution: yogaf commentedYep, It's working.
@Deciphered Please commit - limit tokens just to nodes is not really an option these days.
Thanks.
Comment #9
maximpodorov CreditAttribution: maximpodorov commentedThanks for the patch!
Comment #10
jidrone CreditAttribution: jidrone commentedI used the patch on commerce products and it works perfect.
Comment #11
cosolom CreditAttribution: cosolom commentedIt works for me. Thanks!
Comment #12
kthullThanks for the patch! Worked perfectly for auto-filling the product title in the image field.
Comment #13
yogaf CreditAttribution: yogaf commentedComment #14
colanPlease 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.
Comment #15
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedThe 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.
Comment #16
ysamoylenko CreditAttribution: ysamoylenko at EPAM Systems commentedComment #17
ysamoylenko CreditAttribution: ysamoylenko at EPAM Systems commentedTested with ECK entities.
It works.
The patch will be committed in a short time.
Comment #19
ysamoylenko CreditAttribution: ysamoylenko at EPAM Systems commentedThe patch was committed. Thank all for your participation.
Comment #20
ram4nd CreditAttribution: ram4nd as a volunteer commented