Can't display random products
To create the problem:
- Create a View of Product Displays
- Choose to show just the image
- Select 'Global: Random' as the Sort Criterion
The result:
- Preview doesn't change
Overlay error message:
An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /drupal7/admin/structure/views/view/random_products_for_home_page/preview/page_1/ajax
StatusText: Internal Server Error
ResponseText:
Turning On/Off 'Use AJAX' under Advanced makes no difference.
Adding the 'Indexed Node: Node ID' field to give it something easy to randomize doesn't help.
Removing the image field doesn't help.
Is this a bug, or have I done something wrong?
Comments
Thank you, favrik, your solution works!
> I believe the problem is that a "View of Product Displays" is using the Search API ...
I wasn't aware of that.
> Finally, to avoid duplicate results, you could set "Use aggregation" to "yes" on "Advanced -> Other" section of views.
Hmm... Don't understand this. And, setting aggregation to 'yes' throws up a SQL error.
Yes, some modules simply don't support "Global: Random" sort. xD
Weird error, I didn't get it when testing. What about trying the 2nd answer in this question: http://drupal.stackexchange.com/questions/38450/drupal-7-views-how-to-re... ?