I have a view with several exposed filters.
Accordingly to view->build() method (includes/view.inc file), query() method of each sort handler will be called twice.
First by $this->_build('sort'); call.
And later by $exposed_form->query().

Comments

dawehner’s picture

Good catch! This feels like a bug which should be also fixed in 8.x

IRuslan’s picture

I want to help to fix it.
But i don't understand why problem appears at all.
Why handler's query() called in $exposed_form->query() ? What is the reason?

dawehner’s picture

Well, the reason is, that sort options can be exposed. So if they are exposed they have to get new values, which is done in the exposed form query method(). mhhh

IRuslan’s picture

Then may be query() call should be excluded from $this->_build('sort') for exposed sorts?

dawehner’s picture

Yeah this could be a way, though i'm not sure about the best way.