I've already raised this on the Views module but they say it might be a problem with the date handlers.
#1764902: exposed grouped filter for date not working
I have an exposed "grouped" filter for a date field (field has start and end dates but I expose the start date).
I have 2 options:
- Any -
"Future Events", greater or equal to a relative date "now".
When I preview the view and test the filter, it works.
When I try it on the actual page, it's not working.
Comment | File | Size | Author |
---|---|---|---|
#171 | date-exposed_grouped_filters-1876168-171.patch | 13.15 KB | Alex Bukach |
#170 | 1876168-170--exposed_grouped_filters.patch | 11.48 KB | skylord |
#169 | 1876168-169--exposed_grouped_filters.patch | 12.54 KB | mitjasvab |
#165 | 1876168-165--exposed_grouped_filters.patch | 11.45 KB | skylord |
#161 | 1876168-161--exposed_grouped_filters.patch | 12.61 KB | capysara |
Comments
Comment #1
ali_b CreditAttribution: ali_b commentedAny updates? We are running a pet adoption website and we would love to have an age filter ...
Comment #2
windmaomao CreditAttribution: windmaomao commentedi don't see the input box for entering value either when using grouped exposed filter.
Comment #3
kclarkson CreditAttribution: kclarkson commentedI am also patiently waiting a fix for this,. I am not provided with a box to enter relative dates.
Comment #4
sinn CreditAttribution: sinn commentedMy date filter (I made it as described on http://drupal.org/node/1764902#comment-6732320)
Filter works in view preview only.
Group filter values from exposed filter aren't processed correctly. Attached patch fix it (it isn't very good decision, but I think maintainer will understand where bug is).
Comment #5
sinn CreditAttribution: sinn commentedComment #7
sinn CreditAttribution: sinn commentedComment #9
windmaomao CreditAttribution: windmaomao commentedsinn, can you explain a bit what you did and what bug you fixed ? because after i applied your patch, i still don't see the input box appear. Thanks a ton.
Comment #10
sinn CreditAttribution: sinn commentedwith my patch exposed filter works not only in preview.
i didn't fix UI of settings page.
Comment #11
kclarkson CreditAttribution: kclarkson commentedif the UI wasn't fixed how were you able to enter anything in the fields ?
Comment #12
sinn CreditAttribution: sinn commentedhttp://drupal.org/node/1764902#comment-6732320 -> export views -> change settings -> import views.
Comment #13
svajlenka CreditAttribution: svajlenka commentedI was able to use (more or less) the same group filter as in #4, but when I needed to use this view not in preview *and* using ajax, I had to make the following modifications to the patch in #7 for it work appropriately. This patch includes the changes in #7.
Comment #14
sinn CreditAttribution: sinn commentedCheck line 104 - you have changed meaning of "if" condition.
Comment #15
windmaomao CreditAttribution: windmaomao commentedi'm pretty shocked when I see this bug is still not fixed or committed by the author. And the last updated developer version was from last year.
Comment #16
windmaomao CreditAttribution: windmaomao commentedok, maybe this has been fixed by date_views ? actually it's working without the above patch. see attached picture.
Comment #17
kclarkson CreditAttribution: kclarkson commented@windmaomao
Two questions:
What version of date are u using ?
Did u test this with a custom date field that has a start and end date ?
My use case is for filtering events
Comment #18
MurzConfirm this issue with Views 3.7 and Date 2.6. Patch from #13 isn't solve the problem.
When I change manually group item type from 'offset' to 'relative' (export > change in text editor > import) - it saved correctly, but not work normally, dates are generated like date, not relative.
Comment #19
supradhan CreditAttribution: supradhan commented#18 confirmed. Not fixed yet in views 3.7 and date 2.6. :-(
Comment #20
FreeAndEasy CreditAttribution: FreeAndEasy commentedUI still broken, and once you get it set up like you want to, the grouped filter still only work in the view preview and not on the actual page.
#13 fixed the filter on the actual page for me
Comment #21
mradcliffeI'm confused by this issue.
The patch in #13 is already a part of Date 7.x-2.6, but it's not working either.
@Kim Kahns: Are you applying patch #13 as a reverse patch to remove the code that it says it wants to add because that's what it tries to do any time I apply it to 7.x-2.6.
Comment #22
piepkrak CreditAttribution: piepkrak commentedThis is a partial patch. It only fixes the handler, not the Views UI. The UI bit was fixed by exporting the view using Features and set the filters in code.
Comment #23
Exploratus CreditAttribution: Exploratus commentedI also don't see the input box for entering value either when using grouped exposed filter with a date field. There are workarounds listed here: https://drupal.org/node/1764902, but they dont apply to date module fields.
Comment #24
stella CreditAttribution: stella at Annertech commentedI haven't figured out a solution for the UI issue, but I do know it's caused by the
#states
setting on the textfields, set on lines 375 and 386 of date/date_views/includes/date_views_filter_handler_simple.inc The selector fails to handle the situation where there might be multiple selects with the same class name, which is the situation you have with grouped filters.Comment #25
stella CreditAttribution: stella at Annertech commentedActually even after temporarily modifying the module to make the fields appear, the default values are lost (or at least not loaded) when you go to edit the settings again.
Comment #26
stella CreditAttribution: stella at Annertech commentedI couldn't get the patches above to work for me. The attached patch fixes the handler. However, it doesn't fix the UI - I think that will have to be a combination of patches to both date and views (or a complete overhaul of the date filter UI). I configured my view by doing what I could through the UI and then exporting my view to code and manually fixing the configuration by hand.
Comment #27
stella CreditAttribution: stella at Annertech commentedRevised patch to handle the situation where you're using a content pane and have exposed the view configuration to the panel pane config, rather than displaying the exposed form on the page to the end user. In this situation $_GET and $_REQUEST both aren't set.
Comment #28
bradjones1I can't speak to the issue in #27 since I have yet to use this functionality inside a panel, so this patch builds on #26. In particular this incorporates that code as well as adds a static variable which helps to target the javascript visibility of various elements. (As others have noted, you can manually toggle the visibility with a tool like Firebug or edit the views export and re-import, but many site builders aren't that sophisticated.)
I tried briefly to find another module that would maybe face this same problem but couldn't; I'm far from a views expert but it seems since views is handling the generation of the form so we don't exactly know the broader context inside this individual form construction function.
This isn't perfect as the UI breaks when you add another grouping value by Ajax, but you can just come back in and everything will be visible.
Comment #29
bringevent CreditAttribution: bringevent commentedI found somehow the bug: It seems like that in
views_handler_filter_date.inc function value_form(...)
does not take care about grouped filters. It only takes the correct value[type] for a filter with no groups. I have a fix, but is quiet ugly. The reason is, that I don't know from where the function value_form() may get the information, for which group it has to take the value. So I created a new variable in $this to handover the current group id. The group id is set in the file views_handler_filter.inc in function function build_group_form(..).
I don't know how to upload the fix, the upload always hangs because of the spammer protection.
Comment #30
bradjones1@bringevent - your approach sounds good... curious about your difficulties uploading, though. Are you able to upload patches on other tickets, not just this one? If you think there's a bug on d.o. I'm sure the site maintainers would like to hear about it.
Comment #31
bringevent CreditAttribution: bringevent commented@bradjones1
I'm still not able to upload the whole code because of the new spammer protection of the drupal side...
I sent you an e-mail. Hope you are able to upload this and let the core team know about it, and of course also the community. Thanks
Comment #32
bringevent CreditAttribution: bringevent commentednext try...
in views_handler_filter.inc in function function build_group_form(..) after the foreach statement and before the call to
$this->value_form...
and in views_handler_filter_date.inc function value_form(...) after about line 23:
I have no idea how to report this bugfix idea to the core team: Please let them know about this bugfix. I'm sure, they have a better way to fix this for the next release.
Comment #33
bradjones1@bringevent - Can you provide this as a patch?
As for the patch to views_handler_filter_date.inc, for Drupal 7 that's still contrib code. Not sure if they are handling those now similar to what they do for core patches, which is to provide a patch to the -dev version of Drupal (which would be Views in core D8) and then backport it. But regardless, they should be provided as patches so it's easier for other people to use them.
Comment #34
bradjones1Let's actually do this, everybody - there are two issues here, related but distinct from a code standpoint. As some have noted, a working set of exposed grouped filters can be created manually and imported as part of a views object, using the patch to the get_filter_value function.
That patch is attached, with a tweak to the line that fetches $options. It's working for me on a group of filters that includes some simple filters (e.g., > and <) as well as some between's.
Let's split the UI piece off on to a different ticket, as it could be the solution there is a combination of implementing module functionality and Views itself. That's at #2177055: Exposed, grouped filter configuration is broken inside Views UI
Comment #35
vijaycs85IMHO, I don't see this is working with system date fields like 'created'. so not very sure, it would be date module. It is possible views.
Comment #36
Mirroar CreditAttribution: Mirroar commented@bradjones1 Thanks for the patch, unfortunately it's still only a starting point. It does not work when changing the identifier of the exposed, grouped filter (because it's stored in $this->options['group_info']['identifier'] instead of $this->options['expose']['identifier']). Also, default values are not correctly handled.
I don't have time to create a patch right now, but I'll post my adjusted get_filter_value function for now and try to get back to it and help with the issue if possible.
I don't think it handles multiple default values correctly yet, and I haven't tried if it works when the filter is just optional (mine is required).
Comment #37
danielphenry CreditAttribution: danielphenry commentedPatch in 34 combined with the workaround in 16 got me on my feet.
I have two options
1. end date > today
2. Not null (show all values)
Didn't work on the page or embedded in a quick tab until I applied the patch in 34 and then performed the steps in https://drupal.org/comment/6732320#comment-6732320.
Comment #38
bradjones1Comment #39
mradcliffeWould you be able to provide any details as to this status change, bradjones1?
Comment #40
bradjones1The feedback in #36 suggests my patch above doesn't work in all use cases.
Comment #41
herd45 CreditAttribution: herd45 commentedI'm using the latest dev version and I added the patch in #34.
I have to turn off javascript in the browser in order to set the dates in the exposed/grouped filter. Here's a pic to show what I get if javascript is turned on.
After setting the grouped filter values, I get the following errors......
Notice: Undefined index: operator in date_views_filter_handler_simple->value_validate() (line 455 of ..../sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc).
Notice: Undefined index: operator in date_views_filter_handler_simple->value_validate() (line 455 of ..../sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc).
Notice: Undefined index: operator in date_views_filter_handler_simple->value_validate() (line 485 of ..../sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc).
Notice: Undefined index: value in date_views_filter_handler_simple->value_validate() (line 503 of ..../sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc).
Notice: Undefined index: min_group in date_views_filter_handler_simple->value_validate() (line 503 of ..../sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc).
Notice: Undefined index: max_group in date_views_filter_handler_simple->value_validate() (line 503 of ..../sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc).
When using the filter, the default value is not respected. However, once I change the value and hit apply, it works as it is supposed to. When changing values in a Page view, I get the following errors....
Notice: Undefined index: value in date_views_filter_handler_simple->date_default_value() (line 84 of ..../sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc).
Notice: Undefined index: value in date_views_filter_handler_simple->date_default_value() (line 84 of ..../sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc).
Comment #42
jenlamptonThe patch in #34 is working for me. My process was as follows:
1) create the first views exposed filter option via the UI, not grouped.
2) click the grouping option, add a name, and save immediately.
3) export the view.
4) manually edit the export to account for the other options (in my case, different date ranges)
5) apply the patch.
6) revert the view.
I have a straightforward use case where I'm not trying to change the identifier, or I think anything else mentioned in #36, but would be willing to reroll this patch with some changes if some could be specified.
Comment #43
josebc CreditAttribution: josebc commentedpatch works but im getting a "Notice: Undefined index: value in date_views_filter_handler_simple->date_default_value() (line 84 of xxx/date/date_views/includes/date_views_filter_handler_simple.inc)." warning
thank you
Comment #44
ishworthapaliya CreditAttribution: ishworthapaliya commentedTried #34 and #36 both, working but with warning below when "Use AJAX" is set to no.
warning with #34:
Warning: Illegal offset type in date_views_filter_handler_simple->get_filter_value() (line 109 of xxx\xxx\sites\all\modules\date\date_views\includes\date_views_filter_handler_simple.inc).
warning with #36:
Warning: Illegal offset type in date_views_filter_handler_simple->get_filter_value() (line 120 of xxx\xxx\sites\all\modules\date\date_views\includes\date_views_filter_handler_simple.inc).
Actually, i am using ajax in the view and when in the views page itself and using the filter, it works fine without warning, but the filter form is exposed in other pages also and the problem comes when i try to filter from other pages which is redirected to the views page with the filter parameters in the address bar like: mysite.com/myviewpage?field_something=All&field_datetosearch_value[1]=1
hope it makes sense..
any suggestions/help appreciated.
Thanks!
Comment #45
markspall CreditAttribution: markspall commentedRe the previous comment. Was getting the exact same behaviour. Am running views in panels as a panel pane. Change Use "Panel path: to YES, and Use Ajax to YES and it all works fine now. Hope this helps.
Comment #46
gmariia CreditAttribution: gmariia commentedDears, I have tried all methods mentioned above for my drupal7, views 3 and date module, but nothing works so far... Are there any fresh ideas or custom modules to solve the issue? I just need to filter content by grouped filter options this week, this month, this year, so simple that is just stupid to stuck with it... I would really appreciate any help!!!
Comment #47
ajmantis CreditAttribution: ajmantis commentedThis patch fix the notice show when the default value is empty, but needs work yet
Comment #48
Marko B CreditAttribution: Marko B commentedThe patch works for me in a way that I can save some grouped filter values. How I did is by hackery. I used code inspector to show the relative value fields that are hidden and then I entered values. Problem with this is that they dissappear when you try to edit them and you have to renter everything. This is really heavily screwed part of date views :)
Comment #49
dawehnerI guess views has to pass along the used ID so that date can built up its #states/#depedency properly.
Something like form_state['item_id'] of $form['#item_id'] could for example work. Any oppinion?
Comment #50
zd370 CreditAttribution: zd370 commentedI modified the patch in #34 so that exposed grouped filter work on a date field if there are multiple options in the filter (e.g. Last 30 days, Last 6 months, Last 5 years & etc.) It also includes the fix for warnings in #47. I followed instructions in #42, and with my patch, I was able to make grouped exposed filter work with multiple option and '>=' condition.
Here's what my exported view (filter) looks like:
Comment #51
eigentor CreditAttribution: eigentor commentedThe patch from #50 works for me, together with the method described in #42
So it is not clear, if this is an issue of Views or of Date?
Even with the patch, one can not call it really working, as one has to enter the dates manually into a feature file or export / re-import the view.
@vijaycs85 do you have an idea how to solve the problem?
Comment #52
mitsuroseba CreditAttribution: mitsuroseba commentedThe patch from #50 works for me too, except optional checkbox
http://screencast.com/t/rrXKeGEwKRrp
In my case when page loads one of exp filter options should work, but this does not happen because i think we don't have $_REQUEST param. And then when i switch to another option it works fine
Comment #53
zuzu83 CreditAttribution: zuzu83 commentedThe patch from #50 works for me :)
Comment #54
blazey CreditAttribution: blazey commentedHi,
First of all I wanted to say thank you to all contributors to both date module and views grouped filters feature. Great work.
Here's a patch that solved my problem. My use case is: grouped filter for dates using between operator and concrete dates (not relative). Date widgets are now shown, even if there are multiple groups. Values are correctly saved and filter is working as expected in preview mode.
Patch wasn't tested with single filter (not grouped). Same with relative date, but here, even without testing, I'm pretty sure it won't work so further development is required.
Hope it's a step in right direction. Cheers.
PS. Sorry for no interdiff.
Comment #56
MerryHamster CreditAttribution: MerryHamster commentedThe patch from #54works, thank
Comment #57
Bowevil CreditAttribution: Bowevil commented@blazey I did not see that this was not written for grouped filters and relative dates.
Comment #58
bburgJust trying the patch in #54, and it does not resolve what I think is the issue. The description is unclear to me. But here are the steps I am taking:
The UI that is inserted in the date filter options modal contains a template multi-value list of label/operator/value options. I am able to enter information for the label, change the operator, and change value type (Select a date/Relative date), however, I do not get a field to enter a date for the actual value. Although I do get value fields when I use the "In between" operator, none of the others get a value field.
Comment #59
bburgCorrection, patch in #54 seems to work, but not for pre-existing filter groups. Only for new ones.
Comment #60
bburgOK, so new items get the value fields, but I run into a number of other issues.
Submitting the field, generates a validation error, where it recreates any removed fields with warnings. "In Between" operations seem to have broken. Also, setting a default selection appears to do nothing.
Comment #61
jsbalseraI just tried the patch in #54. It mostly works for me, but when I define a default group it doesn't take it into account. I have made a small change and it's working for me
Comment #63
joelpittetAre you using -dev to create the patch?
Some notes while applying #61
Comment #64
jsbalseraYou are right, this patch was made using the stable release. Sorry about that.
These are the interdiff and the patch using the 7.x-2.x branch.
Comment #65
jsbalseraSorry for the double update, changing status.
Comment #68
DuneBLI have tested #67 but the the field to enter the relative date are/is missing.
I could display them by playing with the "inspect element" feature of my browser and unset "display:none" for those missing field... (See the attached screencapture if I am not clear)
Anyway, after doing this, the filter are working as expected!
Thanks for the patch
Comment #69
skylord CreditAttribution: skylord commented+1 for previous. I think where is one line misplaced in code. Here are fixed patch and interdiff between#64 this one.
Comment #70
DuneBLThank you Skylord, patch#69 solves the visibility problem as explained in #68.
Unfortunately, If I have 2 filters in a group (see attached screencapt), and if I want to set "is less then" "today + 10 day" for the first filter and "less then" "today" for the second filter, I got the following problem:
After clicking "save", I got the same value "today + 10 day" for both filters...
Comment #71
skylord CreditAttribution: skylord commentedI see... It's not because my patch. Options form default values wasn't set correctly. Try this one - works OK for me.
Comment #72
DuneBLSo good Skylord, your patch #71 solved everything.
I didn't meant that #69 was causing the problem in #70; sorry for the confusion.
Comment #73
radone CreditAttribution: radone as a volunteer commented@skylord the patch exposed_grouped_filter-1876168-71.patch is failing to apply
Also, there is a strange line at the end of the patch: "Only in /usr/home/db.tinfocom.ru/public_html/sites/all/modules/contrib/date/date_views/includes: date_views_filter_handler_simple.inc.orig". Was that intended?
Thanks.
Comment #74
rcodina CreditAttribution: rcodina commentedComment #75
radone CreditAttribution: radone as a volunteer commentedPatch exposed_grouped_filter-1876168-71.patch successfully applied after updating date module to Version: 7.x-2.9. My bad :D
Thank you very much @skylord!
Comment #76
NextGame CreditAttribution: NextGame commentedThe patch is not applying properly. We are using date 7.x-2.9
We placed the patch file into the date module folder
patch -p1 < /Users/XXX/Desktop/date/exposed_grouped_filter-1876168-71.patch
The error message is:
can't find file to patch at input line 4
Please provide directions. Thanks.
Comment #77
rcodina CreditAttribution: rcodina commented@NextGame Patches are made just for dev branches. Apply it to 7.x-2.x-dev.
Comment #78
NextGame CreditAttribution: NextGame commentedHello RCodina,
Thanks for your prompt response. We also applied the patch to the 7.x-2.x-dev version and received the same error message. Your help is greatly appreciated.
Thank You.
Comment #79
ChaseOnTheWeb@NextGame Are you running the `patch` command from within in the date module's directory? It doesn't matter if the patch is in the date module folder or not, but if your command line is not in that directory, you'll need to `cd /Users/xxx/Desktop/date/` first.
Comment #80
rcodina CreditAttribution: rcodina commented@NextGame As it's said on comment #73, the patch is broken (sorry, I didn't remember that). So it needs to be rerolled. In the meantime, you could try to apply it manually.
Comment #81
ChaseOnTheWeb@rcodina Poster of comment #73 rescinded theirself in comment #75. I currently have the patch in #71 applying successfully against Date 2.9 (via drush make). Based on @NextGame's error message it looks like a problem in running the patch command not a problem with the patch itself.
(edit: I also just tested this patch against 2.x-dev via drush make and it applied, so no reroll should be necessary at this time)
Comment #82
rcodina CreditAttribution: rcodina commented@marleythedog Ok, so lets change status.
Comment #83
tobiberlinApplied #71 against Date 2.9 and works
Comment #84
rcodina CreditAttribution: rcodina commentedThree good reviews of #71 so far (by @DuneBL, @radone and @tobiberlin). We may change the issue to RTBTC status so it gets commit sooner than later.
Comment #85
mrtcereal CreditAttribution: mrtcereal commented#71 against latest dev did the trick for me. Thanks!
Comment #86
NextGame CreditAttribution: NextGame commentedThank you. It worked. Appreciated.
Comment #87
rcodina CreditAttribution: rcodina commented@NextGame If it works and many good reviews then RTBTC!!!
Comment #88
rcodina CreditAttribution: rcodina commented@NextGame Read this.
Comment #89
jay-dee-ess CreditAttribution: jay-dee-ess as a volunteer commented#71 seems to mostly fix my issues, but I am encountering the following buggy behavior:
- Stored relative dates are hidden in the Views interface when a new filter is added (see image). This carries through after the new one is stored but the view has not yet been saved. Once the view is saved or canceled, all relative dates appear normally.
- Filters are shown but cannot be applied in the Views preview but work outside of it.
Comment #90
zuzu83 CreditAttribution: zuzu83 commentedPatch #71 works with Date 2.9
Thanks
Comment #91
Den Tweed CreditAttribution: Den Tweed commented#71 fixes the issue but still has a problem
Problem: Disappearing relative date field when removing item in combined filter
When adding a combined filter you're having 3 items standard, I only had need for 2 (upcoming/passed) and removed the third with the delete item link. This resulted in having the relative value field disappear from the 2nd item (see http://cl.ly/image/060m0J3h1y30 )
After saving the view and editing the filter the field is shown again
Comment #92
ChaseOnTheWebI ran into an issue with the patch in #71, when making an exposed grouped filter that is optional and defaults to "- Any -". When trying to save the filter settings, I got a series of PHP notices and an error:
The problem appears to be that the filter is trying to figure out the default value and operator for the "Any" value, when it should just be ignored. The attached patch returns nothing when an "Any" is passed; there may be more elegant solutions out there.
This patch also fixes the filter not working in the admin preview, as mentioned in #89.
I have not looked at the hidden field issue reported in #89 and #91.
Comment #93
ChaseOnTheWebThe admin preview fix in #92 is not quite right. Corrected version of #92 attached.
Comment #94
sachbearbeiter CreditAttribution: sachbearbeiter commentedOnly thanks for the efforts ...
Comment #95
jay-dee-ess CreditAttribution: jay-dee-ess as a volunteer commented#93 fixed the Views preview issue for me. Thanks!Unfortunately, #93 has turned out to be spotty. It's working in preview, but now the front end the filters are not working. Reverting back to #71 for now.
Comment #96
MustangGB CreditAttribution: MustangGB commentedReverting #68 IS removal, a bad IS is better than no IS.
Comment #97
coolestdude1 CreditAttribution: coolestdude1 as a volunteer commentedI started off applying the patch from #71 this patch fixes the issue with the front end but it then breaks the preview (issue reversal) and as another user pointed out in #92 I got the same warnings about 'All'. Looking further into it the patch from #93 does not work as that one was tried too which results in view page still not working with grouped date filters.
The problem appears to lie within the following code that is breaking the view front end in patch from #92 and #93
So currently my best bet was to ignore that the view preview will be broken but apply patch #71 and cherry pick parts of #93 interdiff to remove the 'All' warnings. So that is the current state of this ticket, remains 'needs work.'
Cherry picked the following:
And
Comment #98
coolestdude1 CreditAttribution: coolestdude1 as a volunteer commentedLooks like there are more issues here than previously mentioned. I was changing my view again today and found the following issue:
If you change a date grouped filter using radios optional single select TO
date grouped filter using a select drop down multi select optional it causes a WSOD
In short change your radio buttons to check boxes and this will cause the bug.
Error was:
Warning: Illegal offset type in date_views_filter_handler_simple->get_filter_value() (line 120 of /sites/all/modules/contrib/date/date_views/includes/date_views_filter_handler_simple.inc).
WSOD Fatal:
2015/11/11 14:18:19 [error] 15173#0: *180808 FastCGI sent in stderr: "PHP message: PHP Fatal error: Cannot create references to/from string offsets nor overloaded objects in /includes/common.inc on line 6726" while reading response header from upstream, client: 10., request: "GET /franchise-listing?field_kurs_value=&field_brand_value=&field_latest_year_value=1 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "10.", referrer: "/admin/structure/views/view/franchise/edit/page%3Ffield_kurs_value%3D%26field_brand_value%3D%26field_latest_year_value%3D1"
Comment #99
coolestdude1 CreditAttribution: coolestdude1 as a volunteer commentedFurther debugging information for those that are coding:
Problem that I was mentioning appears to be an issue with multi select and the following code:
$identifier = $_GET[$this->options['group_info']['identifier']];
When the identifier for this field is mapped back to the grouped options for changing the date filter this is where the problem is. The $identifier variable appears to be returned as an array in this case (multi select). So when the code that grabs the $options triggers it tries to look for an array index inside of $this->options['group_info']['group_items']
So the issue appears to be that grouped date filters also do not properly support multiple selections (checkbox in views with this title 'Allow multiple selections') with the new patches supplied in this ticket. This could very well be split into it's own ticket however it involves the code being changed in this ticket to make grouped date filters work.
Comment #100
stewest CreditAttribution: stewest commentedI've just updated to lastest 7.x-2.10-beta1, then 7.x-2.x-dev today and Views 7.x-3.13.
Issue:
1. Relative Date input field not showing. (Could this be a jQuery update version issue?)
2. Input values not saving.
1. I still have the issue of the display:none being set on the Relative Date input field.
"form-item form-type-textfield form-item-options-group-info-group-items-1-value-value-group-default-date"
2. Even if I remove the display none, enter the values and save, the values don't change to the new values and the issue persists. The values that was there by default remains.
I have not applied a patch yet, as I hoped it may have been applied in dev branch.
Comment #101
merauluka CreditAttribution: merauluka commentedI'm running #93 on on the latest dev with Views 7.x-3.13 and it's working.
There are still a few issues which I was able to overcome using Chrome's inspector to remove the "display:none;" from the date entry fields.
This isn't apparent on the initial load of the page, but appears when a new filter row is added. All of the "select a date" fields are hidden by jQuery. The fields are still there, and the values remain, but they are hidden.
Comment #102
mitsuroseba CreditAttribution: mitsuroseba for FFW commentedFor review
Comment #103
mitsuroseba CreditAttribution: mitsuroseba for FFW commentedComment #105
mitsuroseba CreditAttribution: mitsuroseba for FFW commentedEnviroment
Views 7.x-3.13
Date 7.x-2.10-beta1 (current dev)
Fixes
Problem was in static counter, cause form rebuilds couple times per request and because of this States API work incorrectly
Comment #106
BR0kENWhy you are wrapped
empty()
by()
?Just
'max' === $prefix ? 'default_to_date' : 'default_date'
.Put else on a new line
Comment #107
capysara CreditAttribution: capysara commentedThe patch from #105 worked for me!
Update: Fixed the default value issue, but potentially caused other issues with filters.
Comment #108
mitsuroseba CreditAttribution: mitsuroseba for FFW commentedComment #109
BR0kENSwap operands and you'll never have an issue like fixed one.
80 symbols per line for comments according to Drupal CS.
Maybe smth like this?
Save, at least, result of
$this->operator_values(2)
to variable.Comment #110
mitsuroseba CreditAttribution: mitsuroseba for FFW commentedComment #111
attheshow CreditAttribution: attheshow at FleetThought commented#110 patch is working for me!
Comment #112
aDarkling CreditAttribution: aDarkling as a volunteer commented#110 patch works over here as well!
Tested with static & relative dates.
Code reviewed by 2 people (1 experienced), Tested by 3 (1 on slightly older version).
Issue > 3 years old on a Major Feature that just hasn't worked before.
Patch solves the problem.
No new bugs appear to be introduced.
No new UI elements added -- simply exposed.
This looks good to go!
Comment #113
BR0kEN#110 do what it should :) Lets commit and finish with this.
Comment #114
MustangGB CreditAttribution: MustangGB commentedI'm curious, what was the purpose of swapping the operands?
Comment #115
mitsuroseba CreditAttribution: mitsuroseba for FFW commentedCause its ease find fatal error from (1 = $i) than small typo.
Comment #116
DuneBLI have tried to group all the patches/issues about this problem into one issue: https://www.drupal.org/node/2704699
Comment #117
podarokThis patch needs tests
Comment #118
xaris.tsimpouris CreditAttribution: xaris.tsimpouris as a volunteer commentedI can also verify that with patch #110 is a really good one:
Date version: 7.x-2.9+6-dev
Comment #119
jcorraoWanted to say that I just had to apply and use patch #71, and it is working for me.
Comment #120
paranojik CreditAttribution: paranojik at BigScreen Group commented#110 broke non-grouped relative date filters. The attached patch tries to fix that also...
Comment #121
aDarkling CreditAttribution: aDarkling as a volunteer commentedPatch looks good. I've first installed it a few weeks ago & used it a few times with no problems.
A cursory code review didn't turn up any issues -- although I'm not overly familiar with this module.
I think its a go!
+1
Comment #122
podarokNeeds tests
Comment #123
joekersPatch is #120 is working well for me!
Comment #124
attheshow CreditAttribution: attheshow at FleetThought commented#120 is working as expected. (I discovered #110 broke relative dates for me on non-grouped filters as stated in #120.)
Comment #125
fonant CreditAttribution: fonant at Fonant Ltd commented#120 working here too. Thank you!
Comment #126
SocialNicheGuru CreditAttribution: SocialNicheGuru commented120 worked for me too
Comment #127
jay-dee-ess CreditAttribution: jay-dee-ess as a volunteer commented#120 works great. I tested across a couple of scenarios and addresses my previous comments -- #89 & #95.
Comment #128
jay-dee-ess CreditAttribution: jay-dee-ess as a volunteer commentedAnnnd...unfortunately it has introduced another issue where relative dates do not work in filters that are not exposed. Rolling back.
Comment #129
aDarkling CreditAttribution: aDarkling as a volunteer commented@jay-dee-ess, please clarify.
Did it break something, or is it just not a complete fix?
Comment #130
jay-dee-ess CreditAttribution: jay-dee-ess as a volunteer commentedA bit of both -- it fixed exposed filters, which worked across all scenarios for me. On the same site, however, I have a date filter which is not exposed. That unexposed filter was broken after I applied the patch.
Comment #131
angelamnr CreditAttribution: angelamnr commentedThis patch fixes a conditional that wouldn't allow unexposed relative date filters to save properly.
Comment #132
drunken monkeyFor me, this addition was necessary to make grouped exposed filters work outside of the Views preview. I really don't know why, if it was already working for everyone else.
Comment #133
angelamnr CreditAttribution: angelamnr commented#132 works great for me!
Comment #134
attheshow CreditAttribution: attheshow at FleetThought commented#132 is working for me as well.
Comment #135
aDarkling CreditAttribution: aDarkling as a volunteer commented#132 is working for me as well.
Comment #136
jay-dee-ess CreditAttribution: jay-dee-ess as a volunteer commented#132 works for me on exposed filters and doesn't break my un-exposed date filters (#130). Thanks!
Comment #137
gambry#132 works for me too, I don't see any issue nor coding standards errors.
However patch still needs tests, but I don't think the date_views submodule has got tests at all.
May be we need maintainers guidelines in here, instead of guessing best approach?
Comment #138
Sut3kh CreditAttribution: Sut3kh commented#132 works great for most situations but unfortunately it breaks other displays if they override it i.e.
- create a view with a grouped exposed filter on a date field
- create a block display and change the filter for 'this block (override)' and apply
Result:
- the exposed filter values show the original (all displays) values when you try and change them again
- the SQL ends up with empty filter values i.e.
DATE_FORMAT(FROM_UNIXTIME(field_data_field_date.field_date_value), '%Y-%m-%d') < ''
Comment #139
attheshow CreditAttribution: attheshow at FleetThought commentedI'm seeing an odd behavior on #132 for un-exposed date filters that use the relative date of "now". It's measuring against the time of 00:00:00 in the query instead of the current time on the server. I tried reverting back to the latest dev version without the page and the relative date of "now" appears to work and adds in the appropriate server time into the query like 16:30.
It's not a huge problem if you don't mind that your events in the views are approximately right (within 24 hours of being right). I'm trying to get them exactly right of course though. ;)
Comment #140
rmoss CreditAttribution: rmoss commentedHi all,
I think I'm seeing the same problem: trying to expose a exposed grouped filter with a date, and the "value" field isn't showing up/sticking.
(this is using date views 7.x-2.10 and views 7.x-3.18).
I was just wondering:
a) what's the latest status? (is it use the patches in #132??)
b) is the fix going to be rolled into a release of views and/or dates (I'm not sure which module the bugs in from reading this)
and
c) ...can someone tell me how to apply those patches? (sorry - I'm new :)
thanks!
Comment #141
drunken monkeyIt seems the patch in #132 is still not perfect. It might solve the problem in your case, though, so feel free to try it out and report back.
Once we have a patch that fixes the problem completely (and doesn't cause other problems elsewhere), it will committed to the Date module and then be part of its next release.
See the Applying patches doc page. The patches are made to be applied from within the module directory.
Comment #142
rmoss CreditAttribution: rmoss commented...sweet - thanks for the info!
...I'll try #132 and let everyone know how it goes
thanks
Comment #143
rmoss CreditAttribution: rmoss commentedFYI ...patch #132 solved the problems for me,
thanks!
Comment #144
jomarocas CreditAttribution: jomarocas commentedHi the patch #132 working good for views ui, and working good in general, please this patch is reviewed and working
Comment #145
MustangGB CreditAttribution: MustangGB commentedComment #146
akolahi CreditAttribution: akolahi commentedIf anyone is still struggling with this, until a patch is provided a solid work-around for me has been to use views_query_alter() in a custom module. First you would need to create the exposed grouped date filter (with blank dates since those don't work). Of course, this is not a long term solution, but at least it will work until we have a good patch.
You can check for the exposed input and alter the query based on it. Example:
hope this helps.
Comment #147
lucastockmann CreditAttribution: lucastockmann at undpaul commentedPatch didn't applied in my case. So I rerolled (#132) it for 7-x-2.10.My fault, please ignore this patch. #132 is working fine.Comment #148
lucastockmann CreditAttribution: lucastockmann at undpaul commentedComment #149
manish34jain CreditAttribution: manish34jain commentedpatch #132 is working.
Comment #150
JKingsnorth CreditAttribution: JKingsnorth commentedAnother thumbs up for #132 - although I haven't conducted a full code review.
I'm not sure why this isn't RTBC - setting it as such now.
Comment #151
MustangGB CreditAttribution: MustangGB commentedIt's quite easy to see why if you read #138 and #139, whether or not this deems it not commit worthy is another matter.
Comment #152
jaysonjaynes CreditAttribution: jaysonjaynes commented#132 worked for me on Date 7.x-2.10. It solved the filtering by date for grouped filters with relative dates. Thanks!
Comment #153
rcodina CreditAttribution: rcodina commentedPatch on #132 works for me too! Thanks!
Comment #154
DamienMcKennaPutting this back to Needs Work per #138, #139. Sorry folks.
Comment #155
rcodina CreditAttribution: rcodina commentedI have checked out problems described on #138 on a new clean Drupal installation with latest versions of views and date with the patch on #132.
I found out that it's not a problem of overriding displays, it's just a problem on "block" type displays: once the patch is applied, date filters are just broken (both single and grouped). In this case, the view displays no results.
However, on "page" type displays they work fine (both single and grouped). Page displays override works fine too. Results are shown and filtered as expected.
Comment #156
sano CreditAttribution: sano as a volunteer commented#132 works for me, with:
Date 7.x-2.10+6-dev
Views 7.x-3.20
Views Exposed Form Fieldset
Comment #157
DuneBLThis patch was ok previously but needs to be rerolled for 7.x-2.x-dev
Comment #158
steinmb CreditAttribution: steinmb as a volunteer commentedComment #159
somersoft CreditAttribution: somersoft commented#132 works for me with:
Date: 7.x-2.10
Views: 7.x-3.20
Comment #160
sri_techie CreditAttribution: sri_techie commented#132 patch works for me with:
Date 7.x-2.10+6-dev
Views 7.x-3.20
Comment #161
capysara CreditAttribution: capysara commentedStill needs the work per #138, but here is the #132 patch re-rolled for the latest dev.
Comment #162
capysara CreditAttribution: capysara commentedComment #163
sano CreditAttribution: sano as a volunteer commentedI found patch #161 working with 7.x-2.11-beta1+8-dev. Thank you.
Comment #164
Petaflopsik CreditAttribution: Petaflopsik commentedPatch # 132 works:
Date 7.x-2.10
Views 7.x-3.23
Comment #165
skylord CreditAttribution: skylord commentedReroll for Date 7.x-2.11-beta3
Comment #166
superelectron CreditAttribution: superelectron as a volunteer commentedHas this been resolved since creation of this bug?
My problem was with 3 filters: a group filter with radio-buttons, id filter, and the date-range. I found a work-around by deleting all filters and starting with the "radio-selection" filter because it had an option for "allow multiple selections." I re-created all other filters as normal and now the date-range works as indended.
I reverted the changed by deleting all filters and recreating the filters in the original order (date-range, fitler, group filter with radio-buttons) and it didn't work. So I changed the group filter to allow multiple and it still didn't work.
Perhaps this is coincidence, but order of operation is important here: I need to create a filter with allow multiple selection so that the SQL query doesn't cut the cheese.
Comment #167
Nathan Tsai CreditAttribution: Nathan Tsai commentedBased off of #146 by akolahi, here's the code I used to achieve "Hide Future Events":
My date views filter:
Comment #168
mnico CreditAttribution: mnico at TIFON commentedI have a question for the patch #165. Why does this line exist?
With this I cannot filter with the relative date "now". It is only to understand it.
Anyway, it seems strange to me that currently version 7.x-3.11 has the same but without replacing the value:
https://git.drupalcode.org/project/date/-/blob/7.x-2.11/date_views/inclu...
Regards
Comment #169
mitjasvab CreditAttribution: mitjasvab as a volunteer commentedReroll for Date 7.x-2.11
Comment #170
skylord CreditAttribution: skylord commentedReroll for 2.12
Comment #171
Alex Bukach CreditAttribution: Alex Bukach commentedReroll for 7.x-2.13.