Environment: Drupal 6.13, views-6.x-2.x, views_calc-6.x-1.3. Create a simple view, say it displays only node title and node id. Apply a filter to node id, expose it and unlock the operator. Show that view on a page. If "Unformatted" style is chosen for the page, the filter allows node ids to be filtered by <, =, > etc. operators and by min/max brackets. The three input fields are selectively exposed depending on the filter operation selected. Apply the filter and notice that the filter works.

Now change the page style to "Views Calc Table". Display a calculation for node id and select "Average" (which is probably not mathematically meaningful but this is the simplest case that demonstrates the problem clearly). Display the page. Notice that the filter input boxes don't appear. View the page source in your browser and notice that the three input fields are on the page but they all have "display: none" applied.

What is happening is that when the style is unformatted, the views_exposed_page_validate() and views_exposed_page_submit() hooks are called. The _submit() hook adds any necessary JavaScript to the page. Changing the style to views calc table causes those two hooks to be called, then the views_calc_table pre_render() hook is called, and it again calls the _validate() and _submit() hooks. Again the _submit() hook adds JavaScript to the form. Some of it replaces the JS that was added by the first hook, but some of the second batch of JS turns scalar variables in the JS into arrays, thus breaking the exposing of the filter input fields.

Cheers, DharmaTech

Comments

dharmatech’s picture