for me, random sort with views does not work.

Comments

erikwebb’s picture

Status: Active » Postponed (maintainer needs more info)

Could you be a bit more specific? Is this problem also appearing without caching enabled? Does the random sort not take affect or just appear the same each time?

jaydub’s picture

For what it's worth I checked this behavior using the stock Views time based cache. If you have a cache time for both query results and rendered output, a Views sort of Global Random will not work. This makes sense since you are caching the query results which will lock in a sort order. If I set the query results to 'never cache' but cache the rendered output, I do get the sort order to be randomized.

For views content cache the behavior is the same. However the query results get cached with the sort order and don't randomize as expected. If I apply the patch in #1815494: Add "Never cache" option to results and output which adds in the option for 'never cache' same as the stock Views time based cache then the sort order is able to be randomized just the same as using the Views time based cache.

So for this to work you should need to apply the patch in the above issue AND set the query results to be never cached. See if that works for you.

colan’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)
hairidine’s picture

Issue summary: View changes

good!