I am trying to filter a view on all updated date <= now (which should be all content), but it does not work. The SQL generated returns 1 row when I run it in MySQL in the command line, but the view does not show this node. It displays the empty message.
When I remove the updated date <= now filter, Views displays the results correctly.
I can duplicate this issue with 6.x-2.0-rc6.
Here is the SQL query:
SELECT node.nid AS nid, node_data_field_offer_type.field_offer_type_value AS node_data_field_offer_type_field_offer_type_value, node_data_field_offer_type.field_purchase_count_value AS node_data_field_offer_type_field_purchase_count_value, RAND() AS _random FROM node node INNER JOIN content_type_media node_data_field_featured ON node.vid = node_data_field_featured.vid LEFT JOIN content_type_media node_data_field_offer_type ON node.vid = node_data_field_offer_type.vid WHERE ((node_data_field_featured.field_featured_value = 'True') AND (node.type in ('media')) AND (node_data_field_featured.field_offer_status_value = 'Active')) AND (DATE_FORMAT(ADDTIME(FROM_UNIXTIME(node.changed), SEC_TO_TIME(-28800)), '%Y-%m-%d') <= '2009-02-18') ORDER BY node_data_field_offer_type_field_offer_type_value DESC, node_data_field_offer_type_field_purchase_count_value DESC, _random ASC
+-----+---------------------------------------------------+-------------------------------------------------------+-------------------+
| nid | node_data_field_offer_type_field_offer_type_value | node_data_field_offer_type_field_purchase_count_value | _random |
+-----+---------------------------------------------------+-------------------------------------------------------+-------------------+
| 910 | 2 | NULL | 0.132777147118726 |
+-----+---------------------------------------------------+-------------------------------------------------------+-------------------+
Comments
Comment #1
karens commentedSaying that you can duplicate the issue in rc6 is not helpful. That is an older version and does not have recent fixes.
Filtering on 'now' does work in the latest code, but you could have old data in a cache or there could be something wrong in your view or you might not have saved it with the values you thought you had or lots of other things.
Make sure you have the latest -dev code. Test first by creating a new view with a date filter to see if that is working. If so and your old view is not working, delete the filter on your old view, save the view, and then re-add the filter and save the view again.
Comment #3
jjo commentedI am having the same issue. Just updated to 6.x-2.1 and date filtering on 'now' does not work.
I have a 'news' content type with a field_date field. Populating this content type works. Displaying the content type works. And viewing and sorting in Views also works. But filtering on field_date does not work. No change to the Views output is observed at all.
Views and CCK are up to date. Any suggestions?
Thanks.
Comment #4
karens commentedDon't reopen this closed issue. There is already a couple reports on this, it is fixed in -dev.
Comment #5
jjo commentedThank you!
Comment #6
alessio_m commentedhey, to me it doesn't look fixed... i'm going totally bananas with this since 2 long days
i'm using Date 6.x-2.x-dev (as suggested) with Views 6.x-2.10
when i set an absolute value for the day everything DOES work fine, DOESN'T work with the relative value 'now'
am i missing something?
PLEASE help ;)
Comment #7
alessio_m commentedInstalled the latest versions of both Date (6.x-2.x-dev) AND Views (6.x-3.x-dev)
Also gone through the whole process of running update.php, clearing caches and everything...
Date filtering on 'now' SILL doesn't work for me
Again, setting the filter on an absolute value DOES work, so everything should be set up right on my side...
Am i the only one here having this (quite crucial) problem?
Any suggestion?
(This is a huge pain in the ass)
Comment #8
superfedya commentedsorry. fixed.
Comment #9
karens commentedI think was caused by the same problem as #580178: Views: SQL Error "Unknown column" when using fields from different content-types in a filter. I reverted that change and I think things are working again.