If you add sort criteria fields like node title you can set it as a exposed form. I guess it would be great if DraggableViews sort criteria is possible to be exposed too. Is this a big thing?

CommentFileSizeAuthor
#7 expose_sort-1540850-7.patch1010 bytesistryker

Comments

checker’s picture

Title: Exposed filter Draggableviews » Exposed sort criteria Draggableviews

Changing title

ygerasimov’s picture

Status: Active » Fixed

I would suggest in this case use Field API handler instead of Native. I believe there you can have exposed filter for sort criteria.

Status: Fixed » Closed (fixed)

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

checker’s picture

That is possible. But with field api you cannot use amazing arguments handling, can I!?

fernly’s picture

Title: Exposed sort criteria Draggableviews » Exposed sort criteria for Native Draggableviews
Issue summary: View changes
Status: Closed (fixed) » Active

checker is correct. The native draggableviews should be exposable.

At this moment other exposed filters are overruling the native draggableviews sorting, even though it's set as first sorting criteria. See #8506355: default draggableviews sort with exposed filter
One of the solutions could be to make it exposable.

grahamc’s picture

I've just been trying to get this to work - the functionality is actually all here, inherited from the default Views sort handler.

The option to enable exposed sort is set to #access = FALSE in the options_form() method in draggableviews_handler_sort.inc - removing that makes it exposable again.

The exposed options do unhelpfully leak into the view arguments, so I had to clean these out using 'Prepare arguments with PHP code' to match my stored weight arguments. Perhaps a warning about this would be useful, if not excluding them automatically?

But otherwise not encountered any problems, so I don't know why this was disabled in the first place.

istryker’s picture

Title: Exposed sort criteria for Native Draggableviews » Add exposed sort criteria for Native Draggableviews
Status: Active » Needs work
StatusFileSize
new1010 bytes

using 'git log -S "$form['expose_button']"' you will find #1410460: Breaking changes with commit b9acb58 or 22a0cd5 that introduce #access false.

I see no reason to have this on the save order display. It just adds confusing. I can see it may be usefully on the other displays.

I tried the follow patch, but it does not work because, as @grahamC said in #6, it leaks the expose options into the view arguments which get save to the database through the POST. I think it tries to load them too.

Again attached patch is just the start.