I have setup a sort criteria with Global: PHP, with this in the "Sort code:" field:

return ($row1->count_1 + $row1->count) < ($row2->count_1 + $row2->count)  ? -1 : (int)($row1->count_1 + $row1->count) < ($row2->count_1 + $row2->count);

It works beautifully (adding up two fields of integers), but the result is not limited by the "Items to display", which is set to 8, but the view outputs all nodes. I should mention, I use a few relationships to determine the flag_count of a node.

Is there something I should do to limit the number of results?

My exported view code here: http://pastebin.com/AgyEhXKN

Comments

jerrylee-1’s picture

I know, it's too late ;) But for those who are still dealing with this problem:
I have used the theming - in my view theme (table), I have put a if statement when rendering the table rows, in your case if it's less than 8, render the row...
This way works for me.
But I would definitely love, if this bug was fixed.

Liam Morland’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Drupal 6 is no longer supported. If this applies to a later version, please re-open and update the version.