I've created a CCK Date field of type datetime (name field_date), but in Views, it does not appear as an option in Filters. Other CCK date fields do appear, such as field_time, a text field.
Is it not supposed to be available, or should I be doing something to make it visible to Views filters?
I'm using the field to hold an event From and To dates, and I want to be able to filter the events to show only those that are from "today" onwards.
| Comment | File | Size | Author |
|---|---|---|---|
| no-datetime-filter.txt | 5.04 KB | iantresman |
Comments
Comment #1
millionleaves commentedI believe this discussion has the answer:
http://drupal.org/node/251128
Regards
David
Comment #2
iantresman commentedThanks for the suggestions, which seem to apply to Views 6.x-2.0-beta1. I tried the suggestions anyway, cleared the Drupal cache, cleared the views cache and Disabled views data caching.
Alas the CCK Date field of type datetime still does not appear in Filters.
Comment #3
crystaldawn commentedI have this same exact problem. Any CCK Date fields simply do not show up as selectable fields in the fields dropdown list in both Filters AND Arguments. The do however show up just fine in the "Fields" dropdown. But displaying the fields simply isnt enough. They need to be filter fields for sorting and what not. This bug has persisted for quite sometime but I believe has gone un-noticed.
@#1 That post is about 2 yrs old and it does not fix this problem anyways so its completely useless. Besides, if this bug had been around for 2yrs, that would just be disgusting :P So I hardly doubt its cache related :)
The real reason that it doesnt work is most likely that it has no argument/filter handlers. At first glance at the source I dont even see a handler at all other than the field handler which isnt enough. So therefore no amount of "cache clearing" would fix anything at all. I have not looked deeply into this problem yet, but I'm sure as I dig deeper I'll either find the handlers and fix the problem or end up creating them myself if they dont even exist to begin with. I cant imagine no one else running into this so before I even look further I'm going to just keep looking through the issues. There has to be a patch to this. I mean its like selling a car with no door. Kind of an obvious part of the machine is missing lol.
Comment #4
crystal_alexandre_froger commentedNo one has never wanted to filter some results depending on a Date custom field?
Is a fix being developped at the moment, or will a next version available soon?
Comment #5
bkno commentedI've ran into this problem too. Subscribing.
Comment #6
crystal_alexandre_froger commentedWell, the filter exists, after all...
I know it is not really user friendly (cf the number of posts about the problem) but here is the method:
- add a "Date: Date (node)" filter
- select your Date field, e.g "Content: Year of birth (field_birth_year)"
- configure the other parameters (user friendly, from this step xD)
And it's done -_-'.
Comment #7
arlinsandbulte commentedYes, there is a second step involved with date fields.
I think this is due to the way date fields integrate with other date info that is available to views (node creation date, for instance, which is not a cck field... I think).
Comment #8
iantresman commentedThanks to cryalex, that seems to do the trick, easy when you know how. The solution is indeed to:
Comment #9
seanrThis is REALLY bad UI - doesn't even make any sense, especially given that it never used to work this way. No new user or existing user used to the old method is going to expect to find it completely buried like that when all other CCK fields show up listed under Content.
Comment #10
karens commentedIt has ALWAYS worked this way, changing it now will confuse people who know where it is. This is not a change.
It was done this way because it can be used for non-CCK date fields as well as CCK date fields and it can only show up in one place. It is its own kind of field, one that transcends CCK and core.
Comment #11
iantresman commentedYou could have both options, keeping everyone happy.
The intuitive option is have the ability to select the CCK date field, where a newby would expect it (ie, show and select Content: Date (field_date)).
But keep the non-intuitive option, requiring oldies who know to select Date: Date (node).
Comment #12
karens commentedViews doesn't support that, it can't be in two places.
Comment #13
harriska2 commentedAt least a note in the arguments area "Select CCK date field within date:date area" would have saved me 1 days worth of scratching my head. I've been using Drupal since about 2004 and views and calendar shortly thereafter. It took me the whole day to find this post (I had to search on "calendar view argument" and sort by date).
Comment #14
arlinsandbulte commentedActually, I think Karen has retracted her statement in #12 above and 'fixed' this issue.
See #963844: "Missing" date filter and argument for more.
Comment #15
mbohner commentedThanks for that. Yes, Date (node) brings up the cck datetime fields.