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.
When using Rendered file formatter, the file description field no longer works correctly. The user should be able to enter a description and have that show up instead of the file name when displaying files as a Generic file link. However, it always shows the file name, even if the description has been set. The code for rendering the description is already in File Entity, but the description is not getting copied to the file object when the file is loaded. The attached patch fixes this.
Comment | File | Size | Author |
---|---|---|---|
file-entity-load-description.patch | 556 bytes | zengenuity | |
#6 | Screenshot from 2013-08-12 06:15:49.png | 145.27 KB | elvis2 |
#5 | Screenshot from 2013-08-12 06:03:54.png | 47.45 KB | elvis2 |
#5 | Screenshot from 2013-08-12 06:04:30.png | 65.2 KB | elvis2 |
#5 | Screenshot from 2013-08-12 06:04:51.png | 36.92 KB | elvis2 |
Comments
Comment #1
Devin Carlson CreditAttribution: Devin Carlson commentedComment #2
ParisLiakos CreditAttribution: ParisLiakos commentedi cant say i completely got the bug..two screenshots would help if you have the time.thanks:)
Comment #3
bneil CreditAttribution: bneil commentedComment #4
elvis2 CreditAttribution: elvis2 commentedI an confirm the issue. You can validate it as well by doing the following:
- create content type (or use article)
- add file field. Be sure to check the checkbox that reads "enable the description field"
- change display for file to be rendered entity (content type manage display)
- goto file manage display (in my case admin/structure/file-types/manage/document/file-display)
- check the "generic file" option
- now create a node and add a file with a description
Attached are screenshots before the patch.
The only thing I would like to add is that the "download link" token should also have the [file:description] token available.
Comment #5
elvis2 CreditAttribution: elvis2 commentedSorry, the images are not described. I thought I could come back and re-edit them. Here they are again...
Comment #6
elvis2 CreditAttribution: elvis2 commentedwow, apparently d.o. does not show file descriptions? Sorry...
Here is the content display with the patch applied.
Comment #7
bneil CreditAttribution: bneil commentedComment #8
aaron CreditAttribution: aaron commentedMake sure to set the file field widget to file when testing. This works as advertised.
Comment #9
EgbertB CreditAttribution: EgbertB commentedYep, works fine. Why is this not yet in the new release?
Comment #10
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedI don't think the patch shows up. for some reason the patch is hidden and all one sees are the pictures.
I think correcting that might help.
Comment #11
Dave ReidThe patch is set to be displayed, so I'm not sure how I can set it to be visible...
https://drupal.org/files/file-entity-load-description.patch
Comment #12
Dave ReidComment #13
Dave ReidComment #14
aaron CreditAttribution: aaron commentedfile-entity-load-description.patch queued for re-testing.
Comment #15
aaron CreditAttribution: aaron commentedCommitted to http://drupalcode.org/project/file_entity.git/commit/3661d8b.