Per request, this is a new issue related to http://drupal.org/node/1011852 . When creating a date filter that uses offsets for "greater than" date comparison no results are being returned. Less then comparisons seem to work. I've confirmed that there is data with post dates that should appear. Attached is a screen shot showing configuration.
View code here: http://drupal.pastebin.com/A5VTVSHg
Versions:
- Drupal 7.0
- Views 7.x-3.x-dev
- Ctools 7.x-1.x-dev
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | 1051308.patch | 3.6 KB | bojanz |
| #16 | 1051308.patch | 1.81 KB | bojanz |
| #1 | fix_date_handler.patch | 1.93 KB | bdragon |
| date comparison configuration | 39.97 KB | ngmaloney |
Comments
Comment #1
bdragon commentedBlame mysql for not erroring on treating a formula as a string. It's silently truncating the offsets because of a bug in the filter handler.
This broke due to the application of #1008706: Convert placeholders to new api.
Comment #2
bdragon commented#1046656: Conversion failed when converting the nvarchar value '1296501225+3600' to data type int closed as works as designed due to catching this bug.
#1029046: Filtering by date marked as dupe.
Comment #3
jcarlson34 commented"greater than or equal to" seems to have also been affected. Thanks for working on a fix.
Comment #4
l33tdawg commentedThanks for the fix - spent a good half a day trying to figure out why things weren't working right using Views 7.x-3.0-alpha1
Comment #5
dawehnerDuring the codesprint in san jose we fixed a big amount of simpletests. One of this fixes includes the filter_date between part.
It would be cool if someone could tryout the d7v3ui branch and look whether the issue is solved there.
Comment #6
bradjones1Patch in #1 works for me.
Comment #7
jimshreds commentedPatch #1 not working with latest dev of Views and CTools
Comment #8
bradjones1@jimshreds, are you working off a CVS copy of Views dev? It works for me with Ctools 7.x-1.0-alpha2 and Views 7.x-3.x-dev. Which are you on?
Comment #9
jimshreds commented@bradjones1
Views 7.x-3.x-dev
CTools 7.x-1.x-dev
date filters just aren't working. 'greater than' and 'in-between' are the two i rely heavily upon.
Comment #10
bradjones1@jimshreds: for what it's worth, you may want to downgrade to CTools 7.x-1.0-alpha2 since the current dev version has a note, "NOT functional yet!"
That said, I'm not a ctools developer and perhaps you need the bleeding-edge version for a specific project. Also I'm not sure this patch would be affected by ctools, anyway, since it looks like the original issue here is a problem with the handling of the filter as a relative date, not just a parseable string.
Can you check to see if the patch is properly applied?
Comment #11
bojanz commentedThat note is from when the dev version was created.
There's nothing wrong with using a dev version of ctools, it's about to become a release anyway...
Comment #12
jimshreds commentedgoing to be working with a different site that requires the same functionality and will see whats what and report back.
thanks!
Comment #13
dawehnerJust backported the fix to 7.x-dev.
Can you please tryout the current dev. Therefore you have to wait some time or get the latest version via git.
Comment #14
draganerorSubscribe
Comment #15
jimshreds commentedupdated to current dev and whenever a datehandler field is used the query comes up blank as before.
Comment #16
bojanz commentedOkay, this is still broken in git. I agree with bdragon's patch, rerolled it to apply again.
Give it a test, confirm it works for you, and RTBC.
Note: Without this patch, three assertions fail in the filter tests (offsets, and two for "not between"). After this patch is applied the offset assertion is passing, but not between still isn't.
Comment #17
jimshreds commentedshould i apply the patch to the git repo or the public dev version?
Comment #18
bojanz commentedToday's dev or git are both fine.
Comment #19
jimshreds commentedstill not working using patched version from git.
Comment #20
bojanz commentedSo, NOT BETWEEN was broken.
Fixed it in this reroll, and tweaked the test comments as well.
All tests now pass.
Comment #21
jimshreds commentedStrummerville:handlers jim$ patch < 1051308.patch
patching file views_handler_filter_date.inc
Hunk #1 FAILED at 123.
Hunk #2 FAILED at 141.
2 out of 2 hunks FAILED -- saving rejects to file views_handler_filter_date.inc.rej
can't find file to patch at input line 51
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/tests/handlers/views_handler_filter_date.test b/tests/handlers/views_handler_filter_date.test
|index 1ff3acd..d618a7d 100644
|--- a/tests/handlers/views_handler_filter_date.test
|+++ b/tests/handlers/views_handler_filter_date.test
--------------------------
File to patch: views_handler_filter_date.inc
patching file views_handler_filter_date.inc
Hunk #1 FAILED at 2.
Hunk #2 FAILED at 79.
Hunk #3 FAILED at 109.
Hunk #4 FAILED at 174.
4 out of 4 hunks FAILED -- saving rejects to file views_handler_filter_date.inc.rej
Comment #22
bojanz commentedDrupal patches since recently need to be applied with patch -p1.
See http://drupal.org/node/1059990
Comment #23
jimshreds commentedstill getting rejected
patching file views_handler_filter_date.inc
Hunk #1 FAILED at 2.
Hunk #2 FAILED at 79.
Hunk #3 FAILED at 109.
Hunk #4 FAILED at 174.
4 out of 4 hunks FAILED -- saving rejects to file views_handler_filter_date.inc.rej
Comment #24
dawehnerAlternative wait some time until someone has commited the patch :)
Comment #25
dawehnerAnd commited. Thanks for all the effort.
Comment #26
jimshreds commentedINBETWEEN and GREATERTHAN still not functioning after updating.
from the calendar issue queue:
http://drupal.org/node/1077262
"
As KarenS posted somewhere else it is a problem caused by a change of the date handling in views. She said she had to change the way date and calendar interact with views in an massive way. That will be the versions 7.x-2.x-dev when it is quite ready.
"
Comment #27
bojanz commentedWe fixed it for core handling.
The fact that date or calendar have problems with it is not something we can fix from Views.
Karen meant that Views changed it's Field API integration many times, hence the need to rewrite the code that depends on it.
Comment #29
millaraj commentedI seem to be running up against this in 7.9 using rc3.
Trying to filter on a date that is greater than "now", but whilst some rows are returned, they are in the past.
The bizzare thing is, when I used drush to enable the dev views so that I can see the SQL (drush views-dev), the query that is returned, if run directly against the db, returns the correct results. However the preview and the subsequent block, still show items that are in the past.
For info, query that is generated by the view is as follows...
The items that appear in the view, are not in the resultset that is generated by the above view.
Have tried poking around in the views module to see if I can figure it out, but it's so vast I'd need a month just to get my head around it. Hoping that someone more well versed can potentially help out?