Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
exposed filters
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
8 Jul 2013 at 20:09 UTC
Updated:
29 Apr 2022 at 17:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Jānis Bebrītis commentedI stumbled across the same issue - we're using views panes and none of sorts would display saved values. I debugged it to views module, filters actually get wrong default values.
Here's patch (for latest 7.x-3.x) I created to solve this issue.
Comment #2
Jānis Bebrītis commentedSomehow I lost the patch, here it is
Comment #3
Jānis Bebrītis commentedchanging status
Comment #4
jlapp commentedThanks Janis, your patch in #2 resolved this issue for me!
Comment #5
dsnopekRTBC +1!
We're using this patch in Panopoly. :-)
Comment #6
guillaumev commentedJust confirming that this is also working on my side.
Comment #7
dsnopekComment #10
mglamanLooks like a test bot hiccup. Putting back to RTC.
Comment #11
thepanz commentedThe patches in #2 fixes the issue and correctly applies on latest 3.11 release.
Comment #12
spesic commentedUpdated #2 to check sort_order property before accessing it to avoid php notice spam. Default to original sort if the property is undefined.
Comment #13
spesic commentedComment #14
nbucknor commentedpatch #12 works for me.
Comment #15
shivneel commentedPatch #12 fixes the issue and correctly applies on 3.11 release for me as well.
Comment #16
dobe commentedSo I have been working on similar issues. I am running panopoly so this patch was already applied. But then I started seeing issues with the default "sort_by" & "sort order" not getting applied for exposed sorts.
I found the issue: https://www.drupal.org/node/666870 which is fairly old but for the most part the approach looked good to me over there. I took that patch applied it to this one in addition I fixed the issue where the default sort order wasn't getting applied.
This patch seems to be fixing all my issues.
If this patch is good we need to make sure to give credit for all those found in: https://www.drupal.org/node/666870
Comment #17
humansky commented#16 Works like a charm.
Also, for the Panopoly folks, I added a patch here: #2782721: Exposed Views Sort Order Bug
Comment #18
rosewrites commentedRefactored #16 a bit to simplify and clarify the logic.
Comment #20
rosewrites commentedComment #21
rosewrites commentedComment #22
rosewrites commentedComment #24
rosewrites commentedComment #25
darrenwh commentedThis is block of code is quite complex and would benefit with some comments to explain the logic?
Comment #26
hswong3i commentedUpdate patch due to #2920737: Tidy up tests, coding standards via latest 7.x-3.x-dev
Comment #27
berramou commentedThanks
#26 patch work for me
Comment #28
teefars commentedThanks hswong3i, #26 works like a charm on latest stable.
Comment #29
cboyden commentedHere's a re-roll of #26 that applies to the latest release 3.25.
Comment #30
djdevinStill works. Setting back to RTBC, we've used this patch in production for 5+ years on hundreds of sites.
Comment #32
damienmckennaCommitted. Thank you.
Comment #33
damienmckenna