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.
In file_entity_file_load, we have this code snippet:
$alt = variable_get('file_entity_alt', '[file:field_file_image_alt_text]');
$title = variable_get('file_entity_title', '[file:field_file_image_title_text]');
These tokens are not evaluated. Instead the code should be the following:
$alt = variable_get('file_entity_alt', '[file:field-file-image-alt-text]');
$title = variable_get('file_entity_title', '[file:field-file-image-title-text]');
Patch attached.
Comment | File | Size | Author |
---|---|---|---|
#16 | file_entity-fix-alt-title-token-2882958-16-d8.patch | 637 bytes | gargsuchi |
#8 | file_entity-fix-alt-title-token-2882958-8-d7.patch | 624 bytes | gargsuchi |
#3 | file_entity-fix-alt-title-token-2882958-3-d7.patch | 636 bytes | gargsuchi |
#3 | file_entity-fix-alt-title-token-2882958-3-d8.patch | 607 bytes | gargsuchi |
file_entity_token.patch | 604 bytes | gargsuchi | |
Comments
Comment #2
gargsuchi CreditAttribution: gargsuchi as a volunteer and commentedAs a workaround, this also works:
drush vset file_entity_alt '[file:field-file-image-alt-text]'
drush vset file_entity_title '[file:field-file-image-title-text]'
Comment #3
gargsuchi CreditAttribution: gargsuchi at Salsa Digital commentedUploading new patches against the latest develop for D7 and D8 both.
Comment #4
wiifmAdd related issue.
Comment #5
joseph.olstadComment #6
joseph.olstadComment #7
joseph.olstadPatch fails to apply to 2.x dev
Comment #8
gargsuchi CreditAttribution: gargsuchi at Salsa Digital commentedUploading D7 patch again.
Comment #9
gargsuchi CreditAttribution: gargsuchi at Salsa Digital commentedD7 patch passes now.
Comment #11
joseph.olstadComment #12
joseph.olstad@gargsuchi , thanks for the patch, looks good afaik.
new tagged release hopefully soon.
Comment #13
gargsuchi CreditAttribution: gargsuchi at Salsa Digital commentedjoseph.olstad
Is there something wrong with the 8.x branch? The test for D8 patch is failing for something that is totally not related to my code changes. The error is "D7 Composer Command Failed".
Comment #14
wiifm@gargsuchi in order to verify the patch for the D8 branch you should:
* re-open this issue
* change the version to 8.x-2.x-dev
* mark as needs review
* click to retest your D8 patch
Comment #15
joseph.olstadswitch to 8.x
Comment #16
gargsuchi CreditAttribution: gargsuchi at Salsa Digital commentedNew D8 patch.
Comment #17
gargsuchi CreditAttribution: gargsuchi at Salsa Digital commented@joseph.olstad
It seems that there is something wrong with the D8 dev branch tests. The failure of D8 patch is totally not related to my changes.
Comment #18
joseph.olstadSee
#2892203: Fix tests for 8.3 core
Comment #20
joseph.olstadFixed