I am attempting to apply a relative date-based filter to a Carousel using standard views 2 or 3 functionality without arguments, etc. Doing so generates a user warning and a non-functional carousel (initial items appear, but no controls and no scrolling beyond what is on the initial page).
A non-relative filter (using a fixed date and time) works fine, but isn't suitable for this particular application.
Steps to reproduce (using JCarousel and either Views 6.x-2.2 or 6.x-2.11 or 6.x-3.0-alpha3)
1) Set up a typical view and Carousel comprised of nodes (use of Ajax and sort order don't matter here, nor does carousel side or initial load amount)
2) Create a filter to restrict nodes by selecting "Node: Post Date"
3) Specify a relative Value Type by choosing "An offset from the current time such as "+1 day" or "-2 hours -30 minutes"
4) Specify a date range by choosing "Is greater than or equal to" for Operator and specifying a suitable Value for your node feed (say "-2 hours" to get a list of nodes generated in the last two hours)
5) Select Update
System response:
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '***CURRENT_TIME***-7200)' at line 5 query: SELECT node.nid AS nid FROM node node LEFT JOIN content_type_feed_item_twitter node_data_field_author_img ON node.vid = node_data_field_author_img.vid LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid WHERE (node.status <> 0) AND (node.type in ('feed_item_twitter')) AND (node.created >= ***CURRENT_TIME***-7200) in /var/www/vanilla/sites/all/modules/jcarousel/includes/jcarousel.views.inc on line 121.
6) Preview the view. The filter should appear to have been applied and the the correct list of items (those posted with the last two hours) pulled from SQL by the view to pass to JCarousel.
7) Save the view at this point (ignoring the warning) and view the carousel (e.g., as a block in a page).
System response:
Carousel appears with initial filtered node items in it (e.g., posted within the last two hours), but lacks controls, does not autoscroll and disappears after some time.
Note that the relative date filter works with other display types (e.g., grid, slideshow), so this appears to be a JCarousel issue. Also, other relative date filters, such as in between, is greater than, etc., also don't seem to work with JCarousel.
Comments
Comment #1
Bird commentedFYI, typo above -- configs tested were JCarousel 6.x-2.2 and Views 6.x-2.11 and 6.x-3.0-alpha3
Comment #2
quicksketchI've confirmed this too, though I'm not sure how or if we'll fix it.
Comment #3
quicksketchThis has been fixed as part of #1052776: Views displays nothing when "Node translation: Language" is set to "Current user's language".
Comment #4
Bird commentedGreat, thanks. Haven't had a chance to verify, but will do so in the next few days.