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.
How can I build a block to show the last image stored in galleries?
Comment | File | Size | Author |
---|---|---|---|
#5 | fix-recently-added-1112466-5.patch | 606 bytes | Moloc |
Comments
Comment #1
David_Rothstein CreditAttribution: David_Rothstein commentedLooks to me like this might be a bug.
In theory the module does this for you, if you choose the "create a block of most recently added media" option when editing the gallery. Then if you set the block to 1 row x 1 column, the block will only show one item - which should be the most recent one.
However, I just tried that now and it doesn't seem to actually be showing the most recent item anymore.
Comment #2
rkp103 CreditAttribution: rkp103 commentedIs there any fix on this?
Comment #3
effulgentsia CreditAttribution: effulgentsia commentedNo fix yet. The culprit is this code in media_gallery_view():
which undoes the ordering performed in media_gallery_block_view().
Comment #4
mmeytin CreditAttribution: mmeytin commentedAny updates on this issue? Doesn't seem to work in the most recent dev version of the Media Gallery. Thanks!
Comment #5
Moloc CreditAttribution: Moloc commentedmedia_gallery_block_view() creates an ordering in the property media_gallery_media and not media_gallery_media_original.
There is no need to distinguish between view-mode full and media_gallery_block in this part of code.
Here is a patch.
Comment #6
helmo CreditAttribution: helmo commentedGreat, that fixes the problem.
Comment #7
lsolesen CreditAttribution: lsolesen commented