Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
dawehnerGood catch! This feels like a bug which should be also fixed in 8.x
Comment #2
IRuslan CreditAttribution: IRuslan commentedI 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?
Comment #3
dawehnerWell, 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
Comment #4
IRuslan CreditAttribution: IRuslan commentedThen may be query() call should be excluded from $this->_build('sort') for exposed sorts?
Comment #5
dawehnerYeah this could be a way, though i'm not sure about the best way.