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.
For example, test "image" file type in "media_preview" view_mode.
/admin/config/media/file-types/manage/image/file-display/media_preview
Activate both "Image
" (#theme
= image_style
) and renderer file
.
Then try to display an image in media_preview.
You'll see that whatever "display precedence order" is chosen, only image (at least in my case) is used.
You can check this with a var_dump($element)
in media_token_to_markup
worth the reading ? #1421444: Does media_format_form() selects file styles the right way ?
Comments
Comment #1
firfin CreditAttribution: firfin commentedI experienced a similar problem.
On the manage file display page for Image (admin/structure/file-types/manage/image/file-display), the 'Enabled displays" were Generic file and Image. Display precedence order was set with "Image" on top and "Generic file" below it. This was so for all display modes (default/teaser/preview).
In the mediabrowser (and all other views) the images did not show as images but as links (i.e. as generic file).
I thought I might have the wrong idea about the order and changed it around. Still image-entities showed up as generic files.
However after changing the order back to image, generic and saving it, the images DID show up. So it seems the default settings or not working perfectly. But re-saving the settings seems to do the trick. I think this constitutes a minor issue, because there is a work-around (re-save settings) and it only affects a small part. Meanwhile the module seems fully functional in other parts related to this setting.
Comment #2
ParisLiakos CreditAttribution: ParisLiakos commented/admin/config/media/file-types/manage/*
is media 1.x
admin/structure/file-types/manage/*
is file_entity 2.x
which one do you refer?
Comment #3
firfin CreditAttribution: firfin commentedI was refering to media 2. drzraf (OP) was refering to media 1 it seems, judging by the path. So my 'solution' will probably not work for OP. My bad, sorry!
Comment #4
ParisLiakos CreditAttribution: ParisLiakos commentedComment #5
palamida CreditAttribution: palamida commentedI'm using the media 7.x-2.x
When you set two displays in the desired order I find that they both have the same row weight - probably when generating the output of the image, displays are taken in alphabetical order.
I solved my problem by enabling "Show row weights" and entering numeric values for row weights
hope this help
Comment #6
deanflory CreditAttribution: deanflory commentedI couldn't get my precedence order to save either. I also tried manually picking a row weight and saving but that still is not working.
I am not using the Media module, therefore this is either core, Display Suite, Entity or File Entity. I'm thinking it should be File Entity.
All this time and effort to set things up just to have this one glaring bug prevent the entire system from being usable in the way it is intended. Grrrr.
Comment #7
deanflory CreditAttribution: deanflory commentedThis error happens when using the draggable handles to reorder as well as the weights.
Comment #8
deanflory CreditAttribution: deanflory commentedAdding what might be a related issue.
Comment #9
deanflory CreditAttribution: deanflory commentedComment #10
deanflory CreditAttribution: deanflory commentedDisplays that are enabled such as "JWPlayer" or "oEmbed" or "Direct download file with the type icon" cannot be disabled once selected/checked and the form saved. Has this functionality not been tested at all? I guess I can't wrap my head around all this work being put into this and these issues of options not saving and not saving in order making the module unusable. I guess I have to disable and then uninstall and re-enable just to start back over and only check 1 item for each file type? Doesn't that then defeat the whole purpose of cascading functionality based on the device/browser's ability?
Comment #11
deanflory CreditAttribution: deanflory commentedChanging this to major as this affects all file usage on a site.
Comment #12
deanflory CreditAttribution: deanflory commentedAltering the "file_display" table's weight column for each enabled item seems to allow them to stay in the order I'd like them to be in, not fun though.