I love being able to expose sort options, but I would like to disable the Order: Asc/Desc selectbox.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Status: Active » Needs work
FileSize
2.97 KB

Sadly the settings are not stored.

dawehner’s picture

+++ plugins/views_plugin_exposed_form.incundefined
@@ -37,6 +37,7 @@ class views_plugin_exposed_form extends views_plugin {
+    $options['sort_options'] = array('default' => array('ASC', 'DESC'));

@@ -91,6 +92,17 @@ class views_plugin_exposed_form extends views_plugin {
+      '#type' => 'select',

Select isn't multiple so this can't work as expected.

Darren Oh’s picture

Version: 6.x-3.0-alpha3 » 7.x-3.5
Status: Needs work » Needs review
FileSize
3.08 KB

I just finished a working patch for the Drupal 7 version. This patch will allow each sort use the order from its own settings.

dawehner’s picture

The patch looks great so far, though it would be probably helpful for the sitebuilder to tell here that instead the default order on the sort setting is used.

Darren Oh’s picture

Additional explanation added.

dawehner’s picture

Version: 7.x-3.5 » 8.x-3.x-dev
FileSize
2.93 KB

This looks perfect know, thanks!

Attached a port to d8, so it would be cool if someone would like to test it, else i think there is no reason not to commit it.

aspilicious’s picture

Well it uses ctools dependencies?

dawehner’s picture

Status: Needs review » Needs work

Good spot!

dawehner’s picture

Status: Needs work » Needs review
FileSize
3.09 KB

This patch should better wait for the moving of ctools autosubmit.

Darren Oh’s picture

Version: 8.x-3.x-dev » 7.x-3.5

I think the patch from #5 should be committed to the 7.x-3.x branch and ported afterwards.

dawehner’s picture

Version: 7.x-3.5 » 8.x-3.x-dev

It got already committed to 7.x-3.x

dawehner’s picture

Issue tags: +VDC

.

Darren Oh’s picture

Added to 7.x-3.x in commit bcd86c0. Thanks!

tim.plunkett’s picture

Status: Needs review » Fixed
tim.plunkett’s picture

Status: Fixed » Closed (fixed)
Issue tags: -VDC

Automatically closed -- issue fixed for 2 weeks with no activity.