Steps to reproduce:

1. Create View
2. Add Views PHP sorting and expose it
3. Add sorting by a field and expose it
4. Save view
5. Go to view, select sorting by a field and see it does not work, sorting is done by Views PHP field.

Comments

dealancer’s picture

Status: Active » Needs review
StatusFileSize
new1.01 KB

Here is a patch that solves this issue. Works fine for exposed sorts. For non exposed sort issue still exists, but it looks like not easy to fix.

quickly’s picture

I was having a similar problem. I had multiple php exposed filters. But always only the last php exposed filter was working. applied the patch in #1 and it solved my problem. Thanks alot @dealancer!

jrlaforge’s picture

I was using a php filter with the module References to add a view in my node form. This solved the problem (don't have sort problem yet).

kuldeep_kumar’s picture

Issue summary: View changes

I am facing same problem in views version "7.x-3.7", and this patch is not working for this version.
In my view i am using multiple sorting criteria with 1 global php field sorting. Without using global php sorting all other sorting(like title, postdate) are working fine but once i add global php sort, it overrides all sorting criteria.
how can i resolve this problem.

Thanks
Kuldeep

yonailo’s picture

I am experiencing the same issue as #4

johnpk’s picture

Hey, the recommended 7.x-1.0-alpha1 release works fine, try that one out.

The patch works absolutely fine, fixed a small warning it throws out and updated the patch.

Hope it helps

skylord’s picture

Hm. #6 can't apply on 1.0-alpha3, but #1 does. Patch is not ideal as it can't work as second sort order but it's by design - mixing sql and software sort in different handlers is some kind of semi impossible as i think. :-) Anyways it works OK for me in simple cases, thanks!

skylord’s picture

StatusFileSize
new668 bytes

Reroll #1 for 7.x-1.0-beta1.

liam morland’s picture

Thanks. Please put this in an issue fork.