The sort widget lets the user select a new field to sort by.
If some facets have been selected by the prior to selecting a new field via the widget this module provides, the facet selection is lost after the widget choice has been submitted.
Interact with
The URLs used to direct the client on submission of the widget form, are provided at form build and passed to the submit handler via $form_state.
Because the facet query parameters are attached to the URL using AJAX requests, the block containing the widget form isn't reloaded; which means the URLs passed to the submit handler are stale (and don't contain the necessary facet query parameters).
This causes the facet selection to be lost.
To remedy this, we can obtain the necessary URLS via calls to the request stack within the submit handler; negating the need for the values to passed when the form is built.
Active
1.0
Code