As designed Missing image in random media block

abdfahim

Well-known member
Affected version
2.0.4
I have set up my random media block to show 4 images (3 at a time). But time to time, it ends up showing 1 or 2 images only keeping the rests of the slots blank. If I refresh the page, everything appears fine again. Just wondering what might cause this behavior.
 
It’s unavoidable unfortunately if you’re using random ordering.

We use a very convoluted approach to select random media items because it’s very difficult to do true random ordering in MySQL without destroying performance.

So at times you may find that you don’t get a full set of results. It can be exacerbated by only having a small number of items to choose from.

If you’re picking random items from categories or albums which will eventually have more items in then you shouldn’t see the issue as frequently.

For example, our random media block should pretty much always have a full set because there’s plenty to choose from.
 
Top Bottom